diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-16 10:30:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-16 12:27:09 +0000 |
commit | f1088250485fa91b4131102c5275e73653bc0c2c (patch) | |
tree | 25e8ccf09155ea72ff5af96a07652499b471cd31 /cui | |
parent | 463f2d4fe211e991d551be67be74cf2090afdb7e (diff) |
Resolves: fdo#59182 make the special character dialog behave
lock down the sizes of the widgets which depend on the (variable) font in terms
of widgets which are invariant so that they don't jump around to their optimal
sizes as the selected font changes.
Change-Id: I65ea24adb43f9faa974025b6db1c35766b577cd7
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 25 | ||||
-rw-r--r-- | cui/source/inc/cuicharmap.hxx | 2 | ||||
-rw-r--r-- | cui/uiconfig/ui/specialcharacters.ui | 27 |
3 files changed, 39 insertions, 15 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index c88da88ba719..2bf01396e655 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -59,8 +59,15 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, sal_Bool bOne_, const SfxItem m_pFontLB->SetStyle(m_pFontLB->GetStyle() | WB_SORT); get(m_pSubsetText, "subsetft"); get(m_pSubsetLB, "subsetlb"); + //lock the size request of this widget to the width of all possible entries + fillAllSubsets(*m_pSubsetLB); + m_pSubsetLB->set_width_request(m_pSubsetLB->get_preferred_size().Width()); get(m_pCharCodeText, "charcodeft"); + //lock the size request of this widget to the width of the original .ui string + m_pCharCodeText->set_width_request(m_pCharCodeText->get_preferred_size().Width()); get(m_pSymbolText, "symboltext"); + //lock the size request of this widget to double the height of the label + m_pShowText->set_height_request(m_pSymbolText->get_preferred_size().Height() * 3); SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, FN_PARAM_1, sal_False ); if ( pItem ) @@ -375,6 +382,18 @@ IMPL_LINK_NOARG(SvxCharacterMap, OKHdl) return 0; } +void SvxCharacterMap::fillAllSubsets(ListBox &rListBox) +{ + SubsetMap aAll(NULL); + rListBox.Clear(); + bool bFirst = true; + while (const Subset *s = aAll.GetNextSubset(bFirst)) + { + rListBox.InsertEntry( s->GetName() ); + bFirst = false; + } +} + // ----------------------------------------------------------------------- IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) @@ -398,6 +417,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) // TODO: get info from the Font once it provides it delete pSubsetMap; pSubsetMap = NULL; + m_pSubsetLB->Clear(); sal_Bool bNeedSubset = (aFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL); if( bNeedSubset ) @@ -407,7 +427,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) pSubsetMap = new SubsetMap( &aFontCharMap ); // update subset listbox for new font's unicode subsets - m_pSubsetLB->Clear(); // TODO: is it worth to improve the stupid linear search? bool bFirst = true; const Subset* s; @@ -424,8 +443,8 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) bNeedSubset = sal_False; } - m_pSubsetText->Show( bNeedSubset); - m_pSubsetLB->Show( bNeedSubset); + m_pSubsetText->Enable(bNeedSubset); + m_pSubsetLB->Enable(bNeedSubset); return 0; } diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx index 13af57378948..d9db58c24a3a 100644 --- a/cui/source/inc/cuicharmap.hxx +++ b/cui/source/inc/cuicharmap.hxx @@ -92,6 +92,8 @@ private: DECL_LINK(CharPreSelectHdl, void *); DECL_LINK(DeleteHdl, void *); + void fillAllSubsets(ListBox &rListBox); + public: SvxCharacterMap( Window* pParent, sal_Bool bOne=sal_True, const SfxItemSet* pSet=0 ); ~SvxCharacterMap(); diff --git a/cui/uiconfig/ui/specialcharacters.ui b/cui/uiconfig/ui/specialcharacters.ui index 94287d84336a..03e3eaed620e 100644 --- a/cui/uiconfig/ui/specialcharacters.ui +++ b/cui/uiconfig/ui/specialcharacters.ui @@ -5,7 +5,6 @@ <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">Special Characters</property> - <property name="resizable">False</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> @@ -19,12 +18,10 @@ <child> <object class="GtkButton" id="ok"> <property name="label">gtk-ok</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -36,11 +33,9 @@ <child> <object class="GtkButton" id="cancel"> <property name="label">gtk-cancel</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> <property name="xalign">0.50999999046325684</property> </object> @@ -53,11 +48,9 @@ <child> <object class="GtkButton" id="help"> <property name="label">gtk-help</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -69,11 +62,9 @@ <child> <object class="GtkButton" id="delete"> <property name="label">gtk-delete</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> <property name="use_stock">True</property> <property name="image_position">bottom</property> </object> @@ -100,12 +91,15 @@ <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="row_spacing">6</property> <property name="column_spacing">6</property> <child> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="column_spacing">6</property> <child> <object class="GtkLabel" id="fontft"> @@ -137,6 +131,7 @@ <object class="GtkComboBox" id="fontlb"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> </object> <packing> <property name="left_attach">1</property> @@ -149,6 +144,7 @@ <object class="GtkComboBox" id="subsetlb"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> </object> <packing> <property name="left_attach">3</property> @@ -169,11 +165,14 @@ <object class="GtkGrid" id="grid3"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <child> <object class="GtkLabel" id="charcodeft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">U+0020(32)</property> + <property name="hexpand">True</property> + <property name="label"> U+FFFF(65535) </property> </object> <packing> <property name="left_attach">0</property> @@ -212,6 +211,8 @@ <property name="height_request">250</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> </object> <packing> <property name="left_attach">0</property> @@ -225,7 +226,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> @@ -239,6 +240,7 @@ <object class="GtkLabel" id="symboltext"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="valign">center</property> <property name="label" translatable="yes">Characters:</property> </object> <packing> @@ -251,6 +253,7 @@ <object class="cuilo:SvxShowText" id="showtext"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="valign">center</property> </object> <packing> <property name="expand">False</property> @@ -267,7 +270,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> |