diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-23 18:53:12 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-23 18:55:40 +0900 |
commit | a39a4c750171e77266391c419fcc0acc67028571 (patch) | |
tree | cc4488580dff0b75380bf8974e910e192f00698c | |
parent | ef934abf7d222035e4261474c322de603bd001da (diff) |
use sliders in CompressGraphicDialog
Change-Id: I272d0f9d56a601b78cbc3e67ff1f87db964d5ccd
-rw-r--r-- | include/svx/compressgraphicdialog.hxx | 3 | ||||
-rw-r--r-- | svx/source/dialog/compressgraphicdialog.cxx | 8 | ||||
-rw-r--r-- | svx/uiconfig/ui/compressgraphicdialog.ui | 97 |
3 files changed, 69 insertions, 39 deletions
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx index cf0c2acaa95c..d933405411ad 100644 --- a/include/svx/compressgraphicdialog.hxx +++ b/include/svx/compressgraphicdialog.hxx @@ -25,6 +25,7 @@ #include <vcl/graph.hxx> #include <vcl/lstbox.hxx> #include <vcl/field.hxx> +#include <vcl/slider.hxx> #include <sfx2/bindings.hxx> #include <svx/svxdllapi.h> @@ -46,7 +47,9 @@ private: VclPtr<RadioButton> m_pLosslessRB; VclPtr<RadioButton> m_pJpegCompRB; VclPtr<NumericField> m_pCompressionMF; + VclPtr<Slider> m_pCompressionSlider; VclPtr<NumericField> m_pQualityMF; + VclPtr<Slider> m_pQualitySlider; VclPtr<PushButton> m_pBtnCalculate; VclPtr<ListBox> m_pInterpolationCombo; diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 48f763a7d791..43656aff665d 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -97,8 +97,10 @@ void CompressGraphicsDialog::Initialize() get(m_pFixedText6, "label-new-capacity"); get(m_pJpegCompRB, "radio-jpeg"); get(m_pCompressionMF, "spin-compression"); + get(m_pCompressionSlider, "scale-compression"); get(m_pLosslessRB, "radio-lossless"); get(m_pQualityMF, "spin-quality"); + get(m_pQualitySlider, "scale-quality"); get(m_pReduceResolutionCB, "checkbox-reduce-resolution"); get(m_pMFNewWidth, "spin-new-width"); get(m_pMFNewHeight, "spin-new-height"); @@ -119,6 +121,9 @@ void CompressGraphicsDialog::Initialize() m_pReduceResolutionCB->SetToggleHdl( LINK( this, CompressGraphicsDialog, ToggleReduceResolutionRB ) ); + m_pQualitySlider->SetLinkedField(m_pQualityMF); + m_pCompressionSlider->SetLinkedField(m_pCompressionMF); + m_pJpegCompRB->Check(); m_pReduceResolutionCB->Check(); @@ -318,8 +323,9 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, ToggleCompressionRB ) { bool choice = m_pLosslessRB->IsChecked(); m_pCompressionMF->Enable(choice); + m_pCompressionSlider->Enable(choice); m_pQualityMF->Enable(!choice); - + m_pQualitySlider->Enable(!choice); return 0L; } diff --git a/svx/uiconfig/ui/compressgraphicdialog.ui b/svx/uiconfig/ui/compressgraphicdialog.ui index 32962b794271..fc973328a81b 100644 --- a/svx/uiconfig/ui/compressgraphicdialog.ui +++ b/svx/uiconfig/ui/compressgraphicdialog.ui @@ -179,7 +179,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Width:</property> <property name="use_underline">True</property> @@ -208,7 +207,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Height:</property> <property name="use_underline">True</property> @@ -241,7 +239,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Resolution:</property> <property name="use_underline">True</property> @@ -296,11 +293,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Quality:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">spin-quality</property> <property name="width_chars">15</property> </object> <packing> @@ -313,11 +308,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Compression:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">spin-compression</property> <property name="width_chars">15</property> </object> <packing> @@ -326,37 +319,10 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="spin-quality"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">•</property> - <property name="adjustment">quality-adjustment</property> - <property name="numeric">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="spin-compression"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">•</property> - <property name="adjustment">compression-adjustment</property> - <property name="numeric">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> <object class="GtkLabel" id="label12"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">12</property> - <property name="hexpand">True</property> <property name="xalign">1</property> <property name="label" translatable="yes">Interpolation:</property> <property name="use_underline">True</property> @@ -416,10 +382,65 @@ </packing> </child> <child> - <placeholder/> + <object class="GtkSpinButton" id="spin-compression"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + <property name="adjustment">compression-adjustment</property> + <property name="numeric">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + </packing> </child> <child> - <placeholder/> + <object class="GtkSpinButton" id="spin-quality"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + <property name="adjustment">quality-adjustment</property> + <property name="numeric">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkScale" id="scale-quality"> + <property name="width_request">100</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="adjustment">quality-adjustment</property> + <property name="fill_level">99</property> + <property name="round_digits">0</property> + <property name="digits">0</property> + <property name="draw_value">False</property> + <property name="value_pos">right</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkScale" id="scale-compression"> + <property name="width_request">200</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="adjustment">compression-adjustment</property> + <property name="fill_level">9</property> + <property name="round_digits">0</property> + <property name="digits">0</property> + <property name="draw_value">False</property> + <property name="value_pos">right</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">3</property> + </packing> </child> <child> <placeholder/> @@ -440,7 +461,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> @@ -628,7 +649,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> |