diff options
author | andreas kainz <kainz.a@gmail.com> | 2020-09-25 14:59:49 +0200 |
---|---|---|
committer | Andreas Kainz <kainz.a@gmail.com> | 2020-09-25 18:03:02 +0200 |
commit | a10585b209c1542ebd2cd0bce6407b8a1c992c48 (patch) | |
tree | 101c664785ad3a649339d6308d1fa2883884c255 /svx | |
parent | cc0ce67a081b72ad401434e9b1a656f480974d4a (diff) |
tdf#137014 Sidebar: Image section remove red/green/blue/gamma
Change-Id: Ia726ef0edbed9ee536c9df7b08901ff60e318b02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103397
Tested-by: Jenkins
Reviewed-by: Andreas Kainz <kainz.a@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/graphic/GraphicPropertyPanel.cxx | 147 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebargraphic.ui | 231 |
2 files changed, 20 insertions, 358 deletions
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx index 5ab60aff01ae..b42509639ffd 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx @@ -52,11 +52,7 @@ GraphicPropertyPanel::GraphicPropertyPanel( mxMtrBrightness(m_xBuilder->weld_metric_spin_button("setbrightness", FieldUnit::PERCENT)), mxMtrContrast(m_xBuilder->weld_metric_spin_button("setcontrast", FieldUnit::PERCENT)), mxLBColorMode(m_xBuilder->weld_combo_box("setcolormode")), - mxMtrTrans(m_xBuilder->weld_metric_spin_button("setgraphtransparency", FieldUnit::PERCENT)), - mxMtrRed(m_xBuilder->weld_metric_spin_button("setred", FieldUnit::PERCENT)), - mxMtrGreen(m_xBuilder->weld_metric_spin_button("setgreen", FieldUnit::PERCENT)), - mxMtrBlue(m_xBuilder->weld_metric_spin_button("setblue", FieldUnit::PERCENT)), - mxMtrGamma(m_xBuilder->weld_spin_button("setgamma")) + mxMtrTrans(m_xBuilder->weld_metric_spin_button("setgraphtransparency", FieldUnit::PERCENT)) { mxLBColorMode->set_size_request(mxLBColorMode->get_preferred_size().Width(), -1); Initialize(); @@ -73,10 +69,6 @@ void GraphicPropertyPanel::dispose() mxMtrContrast.reset(); mxLBColorMode.reset(); mxMtrTrans.reset(); - mxMtrRed.reset(); - mxMtrGreen.reset(); - mxMtrBlue.reset(); - mxMtrGamma.reset(); maBrightControl.dispose(); maContrastControl.dispose(); @@ -101,11 +93,6 @@ void GraphicPropertyPanel::Initialize() mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_MONO)); mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_WATERMARK)); mxLBColorMode->connect_changed( LINK( this, GraphicPropertyPanel, ClickColorModeHdl )); - - mxMtrRed->connect_value_changed( LINK( this, GraphicPropertyPanel, RedHdl ) ); - mxMtrGreen->connect_value_changed( LINK( this, GraphicPropertyPanel, GreenHdl ) ); - mxMtrBlue->connect_value_changed( LINK( this, GraphicPropertyPanel, BlueHdl ) ); - mxMtrGamma->connect_value_changed( LINK( this, GraphicPropertyPanel, GammaHdl ) ); } IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyBrightnessHdl, weld::MetricSpinButton&, void ) @@ -144,42 +131,6 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, weld::ComboBox&, void } -IMPL_LINK_NOARG( GraphicPropertyPanel, RedHdl, weld::MetricSpinButton&, void ) -{ - const sal_Int16 nRed = mxMtrRed->get_value(FieldUnit::PERCENT); - const SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_RED, - SfxCallMode::RECORD, { &aRedItem }); -} - - -IMPL_LINK_NOARG( GraphicPropertyPanel, GreenHdl, weld::MetricSpinButton&, void ) -{ - const sal_Int16 nGreen = mxMtrGreen->get_value(FieldUnit::PERCENT); - const SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_GREEN, - SfxCallMode::RECORD, { &aGreenItem }); -} - - -IMPL_LINK_NOARG(GraphicPropertyPanel, BlueHdl, weld::MetricSpinButton&, void) -{ - const sal_Int16 nBlue = mxMtrBlue->get_value(FieldUnit::PERCENT); - const SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_BLUE, - SfxCallMode::RECORD, { &aBlueItem }); -} - - -IMPL_LINK_NOARG(GraphicPropertyPanel, GammaHdl, weld::SpinButton&, void) -{ - const sal_Int32 nGamma = mxMtrGamma->get_value(); - const SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_GAMMA, - SfxCallMode::RECORD, { &nGammaItem }); -} - - VclPtr<vcl::Window> GraphicPropertyPanel::Create ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, @@ -308,102 +259,6 @@ void GraphicPropertyPanel::NotifyItemUpdate( } break; } - case SID_ATTR_GRAF_RED: - { - if(eState >= SfxItemState::DEFAULT) - { - mxMtrRed->set_sensitive(true); - const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState); - - if(pItem) - { - const sal_Int64 nRed = pItem->GetValue(); - mxMtrRed->set_value(nRed, FieldUnit::PERCENT); - } - } - else if(SfxItemState::DISABLED == eState) - { - mxMtrRed->set_sensitive(false); - } - else - { - mxMtrRed->set_sensitive(true); - mxMtrRed->set_text(OUString()); - } - break; - } - case SID_ATTR_GRAF_GREEN: - { - if(eState >= SfxItemState::DEFAULT) - { - mxMtrGreen->set_sensitive(true); - const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState); - - if(pItem) - { - const sal_Int64 nGreen = pItem->GetValue(); - mxMtrGreen->set_value(nGreen, FieldUnit::PERCENT); - } - } - else if(SfxItemState::DISABLED == eState) - { - mxMtrGreen->set_sensitive(false); - } - else - { - mxMtrGreen->set_sensitive(true); - mxMtrGreen->set_text(OUString()); - } - break; - } - case SID_ATTR_GRAF_BLUE: - { - if(eState >= SfxItemState::DEFAULT) - { - mxMtrBlue->set_sensitive(true); - const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState); - - if(pItem) - { - const sal_Int64 nBlue = pItem->GetValue(); - mxMtrBlue->set_value(nBlue, FieldUnit::PERCENT); - } - } - else if(SfxItemState::DISABLED == eState) - { - mxMtrBlue->set_sensitive(false); - } - else - { - mxMtrBlue->set_sensitive(true); - mxMtrBlue->set_text(OUString()); - } - break; - } - case SID_ATTR_GRAF_GAMMA: - { - if(eState >= SfxItemState::DEFAULT) - { - mxMtrGamma->set_sensitive(true); - const SfxUInt32Item* pItem = dynamic_cast< const SfxUInt32Item* >(pState); - - if(pItem) - { - const sal_Int64 nGamma = pItem->GetValue(); - mxMtrGamma->set_value( nGamma ); - } - } - else if(SfxItemState::DISABLED == eState) - { - mxMtrGamma->set_sensitive(false); - } - else - { - mxMtrGamma->set_sensitive(true); - mxMtrGamma->set_text(OUString()); - } - break; - } } } diff --git a/svx/uiconfig/ui/sidebargraphic.ui b/svx/uiconfig/ui/sidebargraphic.ui index 3a90c21ba34c..0331fbc03ee1 100644 --- a/svx/uiconfig/ui/sidebargraphic.ui +++ b/svx/uiconfig/ui/sidebargraphic.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.22.2 --> <interface domain="svx"> <requires lib="gtk+" version="3.18"/> <object class="GtkAdjustment" id="0to100adjustment"> @@ -26,29 +26,9 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkAdjustment" id="plusminus100adjustment2"> - <property name="lower">-100</property> - <property name="upper">100</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="plusminus100adjustment3"> - <property name="lower">-100</property> - <property name="upper">100</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="plusminus100adjustment4"> - <property name="lower">-100</property> - <property name="upper">100</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> <object class="GtkGrid" id="GraphicPropertyPanel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="row_homogeneous">True</property> - <property name="column_homogeneous">True</property> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> @@ -57,7 +37,6 @@ <property name="vexpand">True</property> <property name="border_width">6</property> <property name="orientation">vertical</property> - <property name="spacing">3</property> <child> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> @@ -197,196 +176,6 @@ <property name="position">0</property> </packing> </child> - <child> - <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="row_spacing">3</property> - <property name="column_spacing">6</property> - <property name="column_homogeneous">True</property> - <child> - <object class="GtkBox" id="box9"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">6</property> - <child> - <object class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon_name">svx/res/symphony/AdjustColorRed_16x16.png</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="setred"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes" context="sidebargraphic|setred|tooltip_text">Red</property> - <property name="adjustment">plusminus100adjustment2</property> - <child internal-child="accessible"> - <object class="AtkObject" id="setred-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setred-atkobject">Red</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkBox" id="box11"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">6</property> - <child> - <object class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon_name">svx/res/symphony/AdjustColorBlue_16x16.png</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="setblue"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes" context="sidebargraphic|setblue|tooltip_text">Blue</property> - <property name="adjustment">plusminus100adjustment4</property> - <child internal-child="accessible"> - <object class="AtkObject" id="setblue-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setblue-atkobject">Blue</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkBox" id="box10"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">6</property> - <child> - <object class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon_name">svx/res/symphony/AdjustColorGreen_16x16.png</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="setgreen"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes" context="sidebargraphic|setgreen|tooltip_text">Green</property> - <property name="adjustment">plusminus100adjustment4</property> - <child internal-child="accessible"> - <object class="AtkObject" id="setgreen-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setgreen-atkobject">Green</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkBox" id="box12"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">6</property> - <child> - <object class="GtkImage" id="image4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="icon_name">svx/res/symphony/AdjustColorGamma_16x16.png</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="setgamma"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes" context="sidebargraphic|setgamma|tooltip_text">Specify the gamma value that affects the brightness of the midtone values.</property> - <property name="adjustment">gammaadjustment</property> - <property name="digits">2</property> - <child internal-child="accessible"> - <object class="AtkObject" id="setgamma-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setgamma-atkobject">Gamma value</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> </object> <packing> <property name="left_attach">0</property> @@ -402,4 +191,22 @@ <widget name="colorlmodelabel"/> </widgets> </object> + <object class="GtkAdjustment" id="plusminus100adjustment2"> + <property name="lower">-100</property> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="plusminus100adjustment3"> + <property name="lower">-100</property> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="plusminus100adjustment4"> + <property name="lower">-100</property> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> </interface> |