svx/source/inc/StylesPreviewWindow.hxx              |    4 -
 svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx |    6 +-
 svx/source/tbxctrls/StylesPreviewWindow.cxx         |    6 +-
 svx/source/tbxctrls/tbcontrl.cxx                    |    4 +
 svx/uiconfig/ui/stylespreview.ui                    |   57 ++++++++++++--------
 sw/uiconfig/swriter/ui/notebookbar.ui               |    1 
 6 files changed, 47 insertions(+), 31 deletions(-)

New commits:
commit 55e0a9f5506ca95238b3b70cb9beb33d089577f4
Author:     andreas kainz <kain...@gmail.com>
AuthorDate: Thu Oct 29 14:31:35 2020 +0100
Commit:     Andreas Kainz <kain...@gmail.com>
CommitDate: Thu Oct 29 23:09:49 2020 +0100

    StylesPreview in Writer NB arrangement in two rows
    
    Change-Id: I05e0b903e7d51cb2487f18f5bbeb6228ba7c945f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105008
    Tested-by: Jenkins
    Reviewed-by: Andreas Kainz <kain...@gmail.com>

diff --git a/svx/source/inc/StylesPreviewWindow.hxx 
b/svx/source/inc/StylesPreviewWindow.hxx
index 2b930672d23f..8381f3b72c49 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -74,7 +74,7 @@ private:
 class StylesPreviewWindow_Base
 {
 protected:
-    static constexpr unsigned STYLES_COUNT = 4;
+    static constexpr unsigned STYLES_COUNT = 6;
 
     std::unique_ptr<StyleItemController> m_xStyleControllers[STYLES_COUNT];
     std::unique_ptr<weld::CustomWeld> m_xStyleControllersWeld[STYLES_COUNT];
@@ -124,4 +124,4 @@ public:
 
 #endif
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx 
b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
index 9b78a0e7aaf0..47995067ae03 100644
--- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
+++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
@@ -68,8 +68,8 @@ void StylesPreviewToolBoxControl::InitializeStyles(
             css::uno::Reference<css::container::XNameAccess> xParaStyles;
             xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") 
>>= xParaStyles;
             static const std::vector<OUString> aWriterStyles
-                = { "Standard",  "Text body", "Title",     "Subtitle",
-                    "Heading 1", "Heading 2", "Heading 3", "Quotations" };
+                = { "Standard",  "Text body", "Heading 1", "Heading 2",  
"Heading 3",
+                    "Heading 4", "Title",     "Subtitle",  "Quotations", 
"Preformatted Text" };
             for (const OUString& aStyle : aWriterStyles)
             {
                 try
@@ -185,4 +185,4 @@ 
com_sun_star_comp_svx_StylesPreviewToolBoxControl_get_implementation(
     return cppu::acquire(new StylesPreviewToolBoxControl());
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx 
b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 7448592f2162..265fea39b956 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -369,7 +369,7 @@ StylesPreviewWindow_Base::StylesPreviewWindow_Base(
 
         m_xStyleControllersWeld[i].reset(
             new weld::CustomWeld(xBuilder, sId, *m_xStyleControllers[i]));
-        m_xStyleControllersWeld[i]->set_size_request(100, 60);
+        m_xStyleControllersWeld[i]->set_size_request(128, 28);
     }
 
     m_xUp->connect_clicked(LINK(this, StylesPreviewWindow_Base, GoUp));
@@ -477,14 +477,14 @@ IMPL_LINK(StylesPreviewWindow_Base, GoUp, const OString&, 
/*rItem*/, void)
     if (m_nStyleIterator == 0)
         m_nStyleIterator = m_aAllStyles.size();
     else
-        m_nStyleIterator--;
+        m_nStyleIterator = m_nStyleIterator - 2;
 
     Update();
 }
 
 IMPL_LINK(StylesPreviewWindow_Base, GoDown, const OString&, /*rItem*/, void)
 {
-    m_nStyleIterator++;
+    m_nStyleIterator = m_nStyleIterator + 2;
     Update();
 }
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index af2eea072998..548aced8073c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2560,7 +2560,9 @@ struct SvxStyleToolBoxControl::Impl
                     "Heading 1",
                     "Heading 2",
                     "Heading 3",
-                    "Quotations"
+                    "Heading 4",
+                    "Quotations",
+                    "Preformatted Text"
                 };
                 for( const OUString& aStyle: aWriterStyles )
                 {
diff --git a/svx/uiconfig/ui/stylespreview.ui b/svx/uiconfig/ui/stylespreview.ui
index fd3edce9cc20..389860619859 100644
--- a/svx/uiconfig/ui/stylespreview.ui
+++ b/svx/uiconfig/ui/stylespreview.ui
@@ -1,32 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.4 -->
+<!-- Generated with glade 3.22.2 -->
 <interface domain="svx">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkBox" id="ApplyStyleBox">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="hexpand">True</property>
-    <property name="spacing">6</property>
     <child>
       <object class="GtkBox">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">3</property>
+        <property name="valign">center</property>
         <child>
-          <object class="GtkBox" id="stylescontainer">
+          <object class="GtkGrid" id="stylescontainer">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="spacing">6</property>
-            <property name="homogeneous">True</property>
+            <property name="valign">center</property>
             <child>
-              <object class="GtkDrawingArea" id="style1">
+              <object class="GtkDrawingArea" id="style4">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkDrawingArea" id="style3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
@@ -35,31 +42,38 @@
                 <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkDrawingArea" id="style3">
+              <object class="GtkDrawingArea" id="style1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkDrawingArea" id="style4">
+              <object class="GtkDrawingArea" id="style5">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkDrawingArea" id="style6">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
           </object>
@@ -73,6 +87,7 @@
           <object class="GtkBox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="valign">center</property>
             <property name="orientation">vertical</property>
             <child>
               <object class="GtkToolbar" id="uptoolbar">
diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui 
b/sw/uiconfig/swriter/ui/notebookbar.ui
index d3fb69d3be4c..9b5416eb805a 100644
--- a/sw/uiconfig/swriter/ui/notebookbar.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar.ui
@@ -4182,7 +4182,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="valign">center</property>
-                        <property name="margin_left">6</property>
                         <property name="margin_right">6</property>
                         <property name="vexpand">True</property>
                         <child>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to