summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-08-16 12:38:05 +0200
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2016-08-16 14:42:12 +0000
commitaa2aa4a6d25874b5c3bb751bd42574b838f75fe2 (patch)
tree09f4e77b233455d8c79abb9bc6982f5062e4a1ae /cui
parent76de7bbf3625efd9f4eeb2183bb0bd22e7a795db (diff)
GSoC notebookbar: icon size switching
+ added entry in the Options > View + changed sfxlo-SidebarToolBox to sfxlo-NotebookbarToolBox in the Notebookbar ui files Change-Id: Id5719953be9830b650af96d54e63936c553cda74 Reviewed-on: https://gerrit.libreoffice.org/28169 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optgdlg.cxx23
-rw-r--r--cui/source/options/optgdlg.hxx2
-rw-r--r--cui/uiconfig/ui/optviewpage.ui41
3 files changed, 60 insertions, 6 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 5c7944d2451a..298c45fc9c1c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -613,6 +613,7 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "OptViewPage", "cui/ui/optviewpage.ui", &rSet)
, nSizeLB_InitialSelection(0)
, nSidebarSizeLB_InitialSelection(0)
+ , nNotebookbarSizeLB_InitialSelection(0)
, nStyleLB_InitialSelection(0)
, pAppearanceCfg(new SvtTabAppearanceCfg)
, pCanvasSettings(new CanvasSettings)
@@ -621,6 +622,7 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
{
get(m_pIconSizeLB, "iconsize");
get(m_pSidebarIconSizeLB, "sidebariconsize");
+ get(m_pNotebookbarIconSizeLB, "notebookbariconsize");
get(m_pIconStyleLB, "iconstyle");
get(m_pFontAntiAliasing, "aafont");
@@ -702,6 +704,7 @@ void OfaViewTabPage::dispose()
pAppearanceCfg = nullptr;
m_pIconSizeLB.clear();
m_pSidebarIconSizeLB.clear();
+ m_pNotebookbarIconSizeLB.clear();
m_pIconStyleLB.clear();
m_pFontAntiAliasing.clear();
m_pAAPointLimitLabel.clear();
@@ -776,6 +779,22 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
aMiscOptions.SetSidebarIconSize( eSet );
}
+ const sal_Int32 nNotebookbarSizeLB_NewSelection = m_pNotebookbarIconSizeLB->GetSelectEntryPos();
+ if( nNotebookbarSizeLB_InitialSelection != nNotebookbarSizeLB_NewSelection )
+ {
+ // from now on it's modified, even if via auto setting the same size was set as now selected in the LB
+ sal_Int16 eSet = TOOLBOX_BUTTONSIZE_DONTCARE;
+ switch( nNotebookbarSizeLB_NewSelection )
+ {
+ case 0: eSet = TOOLBOX_BUTTONSIZE_DONTCARE; break;
+ case 1: eSet = TOOLBOX_BUTTONSIZE_SMALL; break;
+ case 2: eSet = TOOLBOX_BUTTONSIZE_LARGE; break;
+ default:
+ OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_pNotebookbarIconSizeLB should not be possible!" );
+ }
+ aMiscOptions.SetNotebookbarIconSize( eSet );
+ }
+
const sal_Int32 nStyleLB_NewSelection = m_pIconStyleLB->GetSelectEntryPos();
if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
{
@@ -928,6 +947,10 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
nSidebarSizeLB_InitialSelection = aMiscOptions.GetSidebarIconSize();
m_pSidebarIconSizeLB->SelectEntryPos( nSidebarSizeLB_InitialSelection );
m_pSidebarIconSizeLB->SaveValue();
+ if( aMiscOptions.GetNotebookbarIconSize() != TOOLBOX_BUTTONSIZE_DONTCARE )
+ nNotebookbarSizeLB_InitialSelection = aMiscOptions.GetNotebookbarIconSize();
+ m_pNotebookbarIconSizeLB->SelectEntryPos( nNotebookbarSizeLB_InitialSelection );
+ m_pNotebookbarIconSizeLB->SaveValue();
if (aMiscOptions.IconThemeWasSetAutomatically()) {
nStyleLB_InitialSelection = 0;
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 66688811af5a..8df1a3bb1dc6 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -81,6 +81,7 @@ class OfaViewTabPage : public SfxTabPage
private:
VclPtr<ListBox> m_pIconSizeLB;
VclPtr<ListBox> m_pSidebarIconSizeLB;
+ VclPtr<ListBox> m_pNotebookbarIconSizeLB;
VclPtr<ListBox> m_pIconStyleLB;
VclPtr<CheckBox> m_pFontAntiAliasing;
@@ -104,6 +105,7 @@ private:
sal_Int32 nSizeLB_InitialSelection;
sal_Int32 nSidebarSizeLB_InitialSelection;
+ sal_Int32 nNotebookbarSizeLB_InitialSelection;
sal_Int32 nStyleLB_InitialSelection;
SvtTabAppearanceCfg* pAppearanceCfg;
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 8389125c4e00..834b8000d450 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -341,7 +341,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -370,7 +370,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -385,7 +385,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
@@ -400,7 +400,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -413,7 +413,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -445,6 +445,35 @@
<property name="top_attach">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">_Notebookbar icon size:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">iconsize</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="notebookbariconsize">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">Automatic</item>
+ <item translatable="yes">Small</item>
+ <item translatable="yes">Large</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>