include/vcl/weld.hxx                             |    1 
 sd/source/ui/animations/SlideTransitionPane.cxx  |   13 -
 sd/uiconfig/simpress/ui/slidetransitionspanel.ui |  213 ++++++++++++-----------
 3 files changed, 119 insertions(+), 108 deletions(-)

New commits:
commit 580ee655540ccfae461851d298c1f411e809ce39
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 4 14:48:03 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 4 20:55:55 2021 +0100

    allow slide transition panel to be narrower
    
    Change-Id: Ib1fc71fe189b199fef6feb4f5f72f4513dfded97
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111965
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index eda93398b8d6..181b35631c97 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1999,6 +1999,7 @@ public:
     // invalidated when changing the units, range or digits, so to have effect
     // must come after changing those values
     void set_width_chars(int nChars) { m_xSpinButton->set_width_chars(nChars); 
}
+    int get_width_chars() const { return m_xSpinButton->get_width_chars(); }
     weld::SpinButton& get_widget() { return *m_xSpinButton; }
 };
 
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 908f78df3f70..ea56c90f9902 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -427,13 +427,12 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
     mxPB_PLAY = m_xBuilder->weld_button("play");
     mxCB_AUTO_PREVIEW = m_xBuilder->weld_check_button("auto_preview");
 
-    weld::SpinButton& rSpinButton = mxMF_ADVANCE_AUTO_AFTER->get_widget();
-    auto nMax = rSpinButton.get_max();
-    rSpinButton.set_max(1000);
-    Size aOptimalSize(rSpinButton.get_preferred_size());
-    rSpinButton.set_size_request(aOptimalSize.Width(), -1);
-    mxCBX_duration->get_widget().set_size_request(aOptimalSize.Width(), -1);
-    rSpinButton.set_max(nMax);
+    auto nMax = mxMF_ADVANCE_AUTO_AFTER->get_max(FieldUnit::SECOND);
+    mxMF_ADVANCE_AUTO_AFTER->set_max(99, FieldUnit::SECOND);
+    int nWidthChars = mxMF_ADVANCE_AUTO_AFTER->get_width_chars();
+    mxMF_ADVANCE_AUTO_AFTER->set_max(nMax, FieldUnit::SECOND);
+    mxMF_ADVANCE_AUTO_AFTER->set_width_chars(nWidthChars);
+    mxCBX_duration->set_width_chars(nWidthChars);
 
     mxVS_TRANSITION_ICONS.reset(new 
TransitionPane(m_xBuilder->weld_scrolled_window("transitions_iconswin", true)));
     mxVS_TRANSITION_ICONSWin.reset(new weld::CustomWeld(*m_xBuilder, 
"transitions_icons", *mxVS_TRANSITION_ICONS));
diff --git a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui 
b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
index a8c8bed485ec..6f0c01465637 100644
--- a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
+++ b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
@@ -1,56 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.38.2 -->
 <interface domain="sd">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">1000</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
     <property name="upper">1000</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
   </object>
   <object class="GtkImage" id="image1">
     <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="icon_name">sd/res/playblue_16.png</property>
+    <property name="can-focus">False</property>
+    <property name="icon-name">sd/res/playblue_16.png</property>
   </object>
   <object class="GtkBox" id="SlideTransitionsPanel">
     <property name="visible">True</property>
-    <property name="can_focus">False</property>
+    <property name="can-focus">False</property>
     <property name="vexpand">True</property>
-    <property name="border_width">6</property>
+    <property name="border-width">6</property>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkBox" id="box1">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
+        <property name="can-focus">False</property>
         <property name="vexpand">True</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
           <object class="GtkBox" id="box4">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="vexpand">True</property>
             <child>
               <object class="GtkScrolledWindow" id="transitions_iconswin">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="can-focus">True</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="hscrollbar_policy">never</property>
-                <property name="shadow_type">in</property>
+                <property name="hscrollbar-policy">never</property>
+                <property name="shadow-type">in</property>
                 <child>
                   <object class="GtkViewport">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <child>
                       <object class="GtkDrawingArea" id="transitions_icons">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="can-focus">True</property>
                         <property name="events">GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
@@ -80,42 +80,42 @@
         <child>
           <object class="GtkFrame" id="frame1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
+            <property name="can-focus">False</property>
+            <property name="label-xalign">0</property>
+            <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=1 n-rows=1 -->
+              <!-- n-columns=2 n-rows=4 -->
               <object class="GtkGrid" id="grid2">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
-                <property name="margin-start">20</property>
+                <property name="can-focus">False</property>
+                <property name="margin-start">12</property>
                 <property name="margin-top">3</property>
+                <property name="row-spacing">6</property>
+                <property name="column-spacing">12</property>
                 <child>
                   <object class="GtkLabel" id="duration_label">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="halign">end</property>
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|duration_label">Duration:</property>
-                    <property name="use_underline">True</property>
-                    <property 
name="mnemonic_widget">transition_duration</property>
-                    <property name="xalign">0</property>
+                    <property name="use-underline">True</property>
+                    <property 
name="mnemonic-widget">transition_duration</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkSpinButton" id="transition_duration">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="tooltip_text" translatable="yes" 
context="slidetransitionspanel|transition_duration|tooltip_text">Select the 
speed of Slide Transition.</property>
+                    <property name="can-focus">True</property>
+                    <property name="tooltip-text" translatable="yes" 
context="slidetransitionspanel|transition_duration|tooltip_text">Select the 
speed of Slide Transition.</property>
                     <property name="hexpand">True</property>
+                    <property name="truncate-multiline">True</property>
                     <property name="adjustment">adjustment2</property>
                     <property name="digits">2</property>
-                    <property name="truncate-multiline">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" 
id="transition_duration-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|transition_duration">Sets the 
duration of the slide transition.</property>
@@ -123,28 +123,29 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="sound_label">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="halign">end</property>
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|sound_label">Sound:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">sound_list</property>
+                    <property name="use-underline">True</property>
+                    <property name="mnemonic-widget">sound_list</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">2</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkComboBoxText" id="sound_list">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="hexpand">True</property>
                     <items>
                       <item translatable="yes" 
context="slidetransitionspanel|sound_list">No sound</item>
@@ -158,18 +159,18 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">2</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">2</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="loop_sound">
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|loop_sound">Loop until next sound</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="loop_sound-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|loop_sound">Select to play the 
sound repeatedly until another sound starts.</property>
@@ -177,28 +178,29 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">3</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">3</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="variant_label">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="halign">end</property>
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|variant_label">Variant:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">variant_list</property>
+                    <property name="use-underline">True</property>
+                    <property name="mnemonic-widget">variant_list</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkComboBoxText" id="variant_list">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="variant_list-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|variant_list">Select a variation of 
the transition.</property>
@@ -206,8 +208,8 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">0</property>
                   </packing>
                 </child>
                 <child>
@@ -218,7 +220,7 @@
             <child type="label">
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="label" translatable="yes" 
context="slidetransitionspanel|label1">Modify Transition</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -235,27 +237,27 @@
         <child>
           <object class="GtkFrame" id="frame2">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
+            <property name="can-focus">False</property>
+            <property name="label-xalign">0</property>
+            <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=1 n-rows=1 -->
+              <!-- n-columns=2 n-rows=2 -->
               <object class="GtkGrid" id="grid1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
+                <property name="can-focus">False</property>
                 <property name="margin-start">12</property>
-                <property name="margin-top">6</property>
+                <property name="margin-top">3</property>
+                <property name="row-spacing">6</property>
+                <property name="column-spacing">12</property>
                 <child>
                   <object class="GtkRadioButton" id="rb_mouse_click">
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|rb_mouse_click">On mouse click</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
                     <property name="active">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="draw-indicator">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="rb_mouse_click-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|rb_mouse_click">Select to advance 
to the next slide on a mouse click.</property>
@@ -263,19 +265,19 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
                     <property name="width">2</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkRadioButton" id="rb_auto_after">
-                    <property name="label" translatable="yes" 
context="slidetransitionspanel|rb_auto_after">Automatically after:</property>
+                    <property name="label" translatable="yes" 
context="slidetransitionspanel|rb_auto_after">After:</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
                     <property name="group">rb_mouse_click</property>
                     <accessibility>
                       <relation type="label-for" target="auto_after_value"/>
@@ -287,20 +289,21 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkSpinButton" id="auto_after_value">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="truncate-multiline">True</property>
                     <property name="adjustment">adjustment1</property>
                     <property name="digits">2</property>
                     <accessibility>
                       <relation type="labelled-by" target="rb_auto_after"/>
                     </accessibility>
-                    <property name="truncate-multiline">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" 
id="auto_after_value-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|auto_after_value">Select to advance 
to the next slide after a number of seconds. Enter the seconds in the numerical 
field next to the spin button, or click the spin button.</property>
@@ -308,8 +311,8 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
               </object>
@@ -317,7 +320,7 @@
             <child type="label">
               <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="label" translatable="yes" 
context="slidetransitionspanel|label2">Advance Slide</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -334,20 +337,20 @@
         <child>
           <object class="GtkBox" id="box2">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkButtonBox" id="buttonbox1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="layout_style">center</property>
+                <property name="can-focus">False</property>
+                <property name="layout-style">center</property>
                 <child>
                   <object class="GtkButton" id="apply_to_all">
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|apply_to_all">Apply Transition to All 
Slides</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">True</property>
                     <property name="halign">center</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="apply_to_all-atkobject">
@@ -371,7 +374,7 @@
             <child>
               <object class="GtkSeparator" id="separator1">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -382,16 +385,16 @@
             <child>
               <object class="GtkBox" id="box3">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="spacing">18</property>
                 <child>
                   <object class="GtkCheckButton" id="auto_preview">
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|auto_preview">Automatic Preview</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="auto_preview-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|auto_preview">Select to see the 
slide transitions automatically in the document.</property>
@@ -408,13 +411,13 @@
                   <object class="GtkButton" id="play">
                     <property name="label" translatable="yes" 
context="slidetransitionspanel|play">Play</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="tooltip_text" translatable="yes" 
context="slidetransitionspanel|play|tooltip_text">Preview Effect</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">True</property>
+                    <property name="tooltip-text" translatable="yes" 
context="slidetransitionspanel|play|tooltip_text">Preview Effect</property>
                     <property name="image">image1</property>
-                    <property name="use_underline">True</property>
-                    <property name="image_position">right</property>
-                    <property name="always_show_image">True</property>
+                    <property name="use-underline">True</property>
+                    <property name="image-position">right</property>
+                    <property name="always-show-image">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="play-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" context="slidetransitionspanel|extended_tip|play">Shows the 
current slide transition as a preview.</property>
@@ -454,4 +457,12 @@
       </object>
     </child>
   </object>
+  <object class="GtkSizeGroup">
+    <widgets>
+      <widget name="duration_label"/>
+      <widget name="sound_label"/>
+      <widget name="variant_label"/>
+      <widget name="rb_auto_after"/>
+    </widgets>
+  </object>
 </interface>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to