summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-03 12:21:08 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-04 21:50:11 +0900
commitcf43b676044773414fd35172e5e98422a555ede5 (patch)
treebc3677872e113b764d9fe6fe7c989a48fe421ef1 /cui
parentd41e6052aaf31b918ce3e0316c44f19513015b65 (diff)
tdf#124155 change "gradient tab page" - increment & angle slider
Remove slider for increments as the increments should better be left to "auto" and rarely modified (setting a value means it will use a limitied amount of increments, but auto effectively means as much as it is needed and can use the native backend for drawing). OTOH use a slider for setting the "angle" as it is already present in hatch tab page. Angle needs a slider as it is usually one of the main properties of a gradient (especially linear). Increase the tab pages a bit (10px on every side) to have a bit of breating space for all the widgets. Reviewed-on: https://gerrit.libreoffice.org/70175 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 994b41a6c69d20637dcb95894c385f5c0102d600) Change-Id: I66167fe2c97b53bc3627237279332bdd59fb03d7
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/cuitabarea.hxx2
-rw-r--r--cui/source/tabpages/tparea.cxx2
-rw-r--r--cui/source/tabpages/tpgradnt.cxx27
-rw-r--r--cui/uiconfig/ui/gradientpage.ui112
4 files changed, 70 insertions, 73 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index f180f133d6b3..eb90d8a1cb8d 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -353,6 +353,7 @@ private:
VclPtr<MetricField> m_pMtrCenterY;
VclPtr<FixedText> m_pFtAngle;
VclPtr<MetricField> m_pMtrAngle;
+ VclPtr<Slider> m_pSliderAngle;
VclPtr<MetricField> m_pMtrBorder;
VclPtr<Slider> m_pSliderBorder;
VclPtr<SvxColorListBox> m_pLbColorFrom;
@@ -362,7 +363,6 @@ private:
VclPtr<SvxPresetListBox> m_pGradientLB;
VclPtr<NumericField> m_pMtrIncrement;
VclPtr<CheckBox> m_pCbIncrement;
- VclPtr<Slider> m_pSliderIncrement;
VclPtr<SvxXRectPreview> m_pCtlPreview;
VclPtr<PushButton> m_pBtnAdd;
VclPtr<PushButton> m_pBtnModify;
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 38c53d4980e1..d4bf3fb14e6c 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -145,6 +145,8 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
m_pFillTabPage.disposeAndClear();
+ aSize.extendBy(10, 10); // apply a bit of margin
+
m_pFillTab->set_width_request(aSize.Width());
m_pFillTab->set_height_request(aSize.Height());
}
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 86cb408c1a01..a57094674bf1 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -67,13 +67,13 @@ SvxGradientTabPage::SvxGradientTabPage
{
get(m_pCbIncrement, "autoincrement");
get(m_pMtrIncrement, "incrementmtr");
- get(m_pSliderIncrement,"incrementslider");
get(m_pLbGradientType, "gradienttypelb");
get(m_pFtCenter, "centerft");
get(m_pMtrCenterX, "centerxmtr");
get(m_pMtrCenterY, "centerymtr");
get(m_pFtAngle, "angleft");
get(m_pMtrAngle, "anglemtr");
+ get(m_pSliderAngle, "angleslider");
get(m_pMtrBorder, "bordermtr");
get(m_pSliderBorder, "borderslider");
get(m_pLbColorFrom, "colorfromlb");
@@ -94,10 +94,10 @@ SvxGradientTabPage::SvxGradientTabPage
// as long as NOT supported by the item
- m_pSliderIncrement->SetRange(Range(3,256));
m_pMtrColorTo->SetValue( 100 );
m_pMtrColorFrom->SetValue( 100 );
m_pSliderBorder->SetRange(Range(0,100));
+ m_pSliderAngle->SetRange(Range(0,359));
// setting the output device
m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_GRADIENT) );
@@ -117,10 +117,10 @@ SvxGradientTabPage::SvxGradientTabPage
m_pLbGradientType->SetSelectHdl( aLink2 );
m_pCbIncrement->SetToggleHdl( LINK( this, SvxGradientTabPage, ChangeAutoStepHdl_Impl ) );
m_pMtrIncrement->SetModifyHdl( aLink );
- m_pSliderIncrement->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) );
m_pMtrCenterX->SetModifyHdl( aLink );
m_pMtrCenterY->SetModifyHdl( aLink );
m_pMtrAngle->SetModifyHdl( aLink );
+ m_pSliderAngle->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) );
m_pMtrBorder->SetModifyHdl( aLink );
m_pSliderBorder->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) );
m_pMtrColorFrom->SetModifyHdl( aLink );
@@ -144,13 +144,13 @@ void SvxGradientTabPage::dispose()
{
m_pCbIncrement.clear();
m_pMtrIncrement.clear();
- m_pSliderIncrement.clear();
m_pLbGradientType.clear();
m_pFtCenter.clear();
m_pMtrCenterX.clear();
m_pMtrCenterY.clear();
m_pFtAngle.clear();
m_pMtrAngle.clear();
+ m_pSliderAngle.clear();
m_pMtrBorder.clear();
m_pSliderBorder.clear();
m_pLbColorFrom.clear();
@@ -262,7 +262,6 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
void SvxGradientTabPage::Reset( const SfxItemSet* )
{
m_pMtrIncrement->SetValue(DEFAULT_GRADIENTSTEP);
- m_pSliderIncrement->SetThumbPos(DEFAULT_GRADIENTSTEP);
ChangeGradientHdl_Impl();
// determine state of the buttons
@@ -308,12 +307,10 @@ IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, CheckBox&, void )
{
if(m_pCbIncrement->IsChecked())
{
- m_pSliderIncrement->Disable();
m_pMtrIncrement->Disable();
}
else
{
- m_pSliderIncrement->Enable();
m_pMtrIncrement->Enable();
}
ModifiedHdl_Impl(m_pMtrIncrement);
@@ -325,10 +322,10 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl )
m_pSliderBorder->SetThumbPos( m_pMtrBorder->GetValue() );
if( pControl == m_pSliderBorder )
m_pMtrBorder->SetValue( m_pSliderBorder->GetThumbPos() );
- if( pControl == m_pMtrIncrement )
- m_pSliderIncrement->SetThumbPos( m_pMtrIncrement->GetValue() );
- if(pControl == m_pSliderIncrement)
- m_pMtrIncrement->SetValue( m_pSliderIncrement->GetThumbPos() );
+ if( pControl == m_pMtrAngle )
+ m_pSliderAngle->SetThumbPos( m_pMtrAngle->GetValue() );
+ if(pControl == m_pSliderAngle)
+ m_pMtrAngle->SetValue( m_pSliderAngle->GetThumbPos() );
css::awt::GradientStyle eXGS = (css::awt::GradientStyle) m_pLbGradientType->GetSelectedEntryPos();
@@ -581,15 +578,12 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl()
{
m_pCbIncrement->SetState(TRISTATE_TRUE);
m_pMtrIncrement->Disable();
- m_pSliderIncrement->Disable();
}
else
{
m_pCbIncrement->SetState(TRISTATE_FALSE);
m_pMtrIncrement->Enable();
m_pMtrIncrement->SetValue( nValue );
- m_pSliderIncrement->Enable();
- m_pSliderIncrement->SetThumbPos( nValue );
}
m_pLbGradientType->SelectEntryPos(
sal::static_int_cast< sal_Int32 >( eXGS ) );
@@ -602,6 +596,7 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl()
m_pLbColorTo->SelectEntry( pGradient->GetEndColor() );
m_pMtrAngle->SetValue( pGradient->GetAngle() / 10 ); // should be changed in resource
+ m_pSliderAngle->SetThumbPos( pGradient->GetAngle() / 10 );
m_pMtrBorder->SetValue( pGradient->GetBorder() );
m_pSliderBorder->SetThumbPos( pGradient->GetBorder() );
m_pMtrCenterX->SetValue( pGradient->GetXOffset() );
@@ -633,6 +628,7 @@ void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS )
m_pMtrCenterY->Disable();
m_pFtAngle->Enable();
m_pMtrAngle->Enable();
+ m_pSliderAngle->Enable();
break;
case css::awt::GradientStyle_RADIAL:
@@ -641,6 +637,7 @@ void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS )
m_pMtrCenterY->Enable();
m_pFtAngle->Disable();
m_pMtrAngle->Disable();
+ m_pSliderAngle->Disable();
break;
case css::awt::GradientStyle_ELLIPTICAL:
@@ -649,6 +646,7 @@ void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS )
m_pMtrCenterY->Enable();
m_pFtAngle->Enable();
m_pMtrAngle->Enable();
+ m_pSliderAngle->Enable();
break;
case css::awt::GradientStyle_SQUARE:
@@ -658,6 +656,7 @@ void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS )
m_pMtrCenterY->Enable();
m_pFtAngle->Enable();
m_pMtrAngle->Enable();
+ m_pSliderAngle->Enable();
break;
default:
break;
diff --git a/cui/uiconfig/ui/gradientpage.ui b/cui/uiconfig/ui/gradientpage.ui
index 1c278de00ce1..daa95c0255e6 100644
--- a/cui/uiconfig/ui/gradientpage.ui
+++ b/cui/uiconfig/ui/gradientpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.0"/>
<requires lib="LibreOffice" version="1.0"/>
@@ -203,19 +203,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScale" id="incrementslider">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="round_digits">1</property>
- <property name="draw_value">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -227,7 +215,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -236,6 +224,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="hexpand">True</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -245,12 +234,6 @@
<property name="top_attach">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -266,33 +249,6 @@
<property name="row_spacing">3</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkLabel" id="angleft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="gradientpage|angleft">A_ngle:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">anglemtr:0degrees</property>
- <property name="xalign">0</property>
- <property name="yalign">0.43999999761581421</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="anglemtr:0degrees">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="adjustment">angleadjustment</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
<object class="GtkLabel" id="centerft">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -304,6 +260,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -344,11 +301,12 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
+ <property name="width">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
@@ -372,7 +330,8 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -385,7 +344,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -398,11 +357,50 @@
</object>
<packing>
<property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="angleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="gradientpage|angleft">A_ngle:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">anglemtr:0degrees</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.43999999761581421</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScale" id="angleslider">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="draw_value">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkSpinButton" id="anglemtr:0degrees">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">angleadjustment</property>
+ <property name="value">15</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
</child>
</object>
<packing>
@@ -430,12 +428,14 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
<object class="svxcorelo-SvxColorListBox" id="colorfromlb">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
@@ -457,9 +457,6 @@
<property name="top_attach">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">True</property>
@@ -478,6 +475,7 @@
<object class="svxcorelo-SvxColorListBox" id="colortolb">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
@@ -511,11 +509,9 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">False</property>