summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-18 21:30:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-20 12:41:53 +0200
commit1f8d45c276760a173c3e30c78b8b740414a5b05f (patch)
tree4e22f39b8515a1839c9dc64146725ca02ec9b6f9 /cui
parent6e5e83025c948b699bb65839ef810a45a98ba014 (diff)
weld SvxColorTabPage
Change-Id: I5dc6f949edcb34aa110dfa9415e2ac886d0dfa4c Reviewed-on: https://gerrit.libreoffice.org/56111 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/cuitabarea.hxx94
-rw-r--r--cui/source/tabpages/tpcolor.cxx419
-rw-r--r--cui/uiconfig/ui/colorpage.ui242
3 files changed, 359 insertions, 396 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 7a72431bb9a5..2c8e55234fe9 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -654,43 +654,6 @@ class SvxColorTabPage : public SfxTabPage
private:
VclPtr<Window> mpTopDlg;
- PaletteManager maPaletteManager;
- VclPtr<ListBox> m_pSelectPalette;
- VclPtr<SvxColorValueSet> m_pValSetColorList;
- VclPtr<SvxColorValueSet> m_pValSetRecentList;
-
- VclPtr<SvxXRectPreview> m_pCtlPreviewOld;
- VclPtr<SvxXRectPreview> m_pCtlPreviewNew;
-
- VclPtr<RadioButton> m_pRbRGB;
- VclPtr<RadioButton> m_pRbCMYK;
-
- VclPtr<VclContainer> m_pRGBcustom;
- VclPtr<VclContainer> m_pRGBpreset;
- VclPtr<NumericField> m_pRcustom;
- VclPtr<NumericField> m_pRpreset;
- VclPtr<NumericField> m_pGcustom;
- VclPtr<NumericField> m_pGpreset;
- VclPtr<NumericField> m_pBcustom;
- VclPtr<NumericField> m_pBpreset;
- VclPtr<HexColorControl> m_pHexpreset;
- VclPtr<HexColorControl> m_pHexcustom;
-
- VclPtr<VclContainer> m_pCMYKcustom;
- VclPtr<VclContainer> m_pCMYKpreset;
- VclPtr<MetricField> m_pCcustom;
- VclPtr<MetricField> m_pCpreset;
- VclPtr<MetricField> m_pYcustom;
- VclPtr<MetricField> m_pYpreset;
- VclPtr<MetricField> m_pMcustom;
- VclPtr<MetricField> m_pMpreset;
- VclPtr<MetricField> m_pKcustom;
- VclPtr<MetricField> m_pKpreset;
-
- VclPtr<PushButton> m_pBtnAdd;
- VclPtr<PushButton> m_pBtnDelete;
- VclPtr<PushButton> m_pBtnWorkOn;
-
const SfxItemSet& rOutAttrs;
XColorListRef pColorList;
@@ -705,6 +668,44 @@ private:
Color aPreviousColor;
Color aCurrentColor;
+ css::uno::Reference< css::uno::XComponentContext > m_context;
+
+ PaletteManager maPaletteManager;
+ XRectPreview m_aCtlPreviewOld;
+ XRectPreview m_aCtlPreviewNew;
+ std::unique_ptr<ColorValueSet> m_xValSetColorList;
+ std::unique_ptr<ColorValueSet> m_xValSetRecentList;
+ std::unique_ptr<weld::ComboBoxText> m_xSelectPalette;
+ std::unique_ptr<weld::RadioButton> m_xRbRGB;
+ std::unique_ptr<weld::RadioButton> m_xRbCMYK;
+ std::unique_ptr<weld::Widget> m_xRGBcustom;
+ std::unique_ptr<weld::Widget> m_xRGBpreset;
+ std::unique_ptr<weld::Entry> m_xRpreset;
+ std::unique_ptr<weld::Entry> m_xGpreset;
+ std::unique_ptr<weld::Entry> m_xBpreset;
+ std::unique_ptr<weld::SpinButton> m_xRcustom;
+ std::unique_ptr<weld::SpinButton> m_xGcustom;
+ std::unique_ptr<weld::SpinButton> m_xBcustom;
+ std::unique_ptr<weld::HexColorControl> m_xHexpreset;
+ std::unique_ptr<weld::HexColorControl> m_xHexcustom;
+ std::unique_ptr<weld::Widget> m_xCMYKcustom;
+ std::unique_ptr<weld::Widget> m_xCMYKpreset;
+ std::unique_ptr<weld::Entry> m_xCpreset;
+ std::unique_ptr<weld::Entry> m_xYpreset;
+ std::unique_ptr<weld::Entry> m_xMpreset;
+ std::unique_ptr<weld::Entry> m_xKpreset;
+ std::unique_ptr<weld::MetricSpinButton> m_xCcustom;
+ std::unique_ptr<weld::MetricSpinButton> m_xYcustom;
+ std::unique_ptr<weld::MetricSpinButton> m_xMcustom;
+ std::unique_ptr<weld::MetricSpinButton> m_xKcustom;
+ std::unique_ptr<weld::Button> m_xBtnAdd;
+ std::unique_ptr<weld::Button> m_xBtnDelete;
+ std::unique_ptr<weld::Button> m_xBtnWorkOn;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreviewOld;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreviewNew;
+ std::unique_ptr<weld::CustomWeld> m_xValSetColorListWin;
+ std::unique_ptr<weld::CustomWeld> m_xValSetRecentListWin;
+
static void ConvertColorValues (Color& rColor, ColorModel eModell);
static void RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK );
static void CmykToRgb_Impl( Color& rColor, const sal_uInt16 nKey );
@@ -714,27 +715,28 @@ private:
void ImpColorCountChanged();
void FillPaletteLB();
- DECL_LINK( ClickAddHdl_Impl, Button*, void );
- DECL_LINK( ClickWorkOnHdl_Impl, Button*, void );
- DECL_LINK( ClickDeleteHdl_Impl, Button*, void );
+ DECL_LINK(ClickAddHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickWorkOnHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void);
- DECL_LINK( SelectPaletteLBHdl, ListBox&, void );
- DECL_LINK( SelectValSetHdl_Impl, ValueSet*, void );
- DECL_LINK( SelectColorModeHdl_Impl, RadioButton&, void );
+ DECL_LINK(SelectPaletteLBHdl, weld::ComboBoxText&, void);
+ DECL_LINK( SelectValSetHdl_Impl, SvtValueSet*, void );
+ DECL_LINK( SelectColorModeHdl_Impl, weld::ToggleButton&, void );
void ChangeColor(const Color &rNewColor, bool bUpdatePreset = true);
void SetColorModel(ColorModel eModel);
void ChangeColorModel();
void UpdateColorValues( bool bUpdatePreset = true );
- DECL_LINK( ModifiedHdl_Impl, Edit&, void );
+ DECL_LINK(SpinValueHdl_Impl, weld::SpinButton&, void);
+ DECL_LINK(MetricSpinValueHdl_Impl, weld::MetricSpinButton&, void);
+ DECL_LINK(ModifiedHdl_Impl, weld::Entry&, void);
void UpdateModified();
- css::uno::Reference< css::uno::XComponentContext > m_context;
static sal_Int32 FindInCustomColors( OUString const & aColorName );
sal_Int32 FindInPalette( const Color& rColor );
public:
- SvxColorTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxColorTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxColorTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index f73359468cbe..113d1f9fb8a8 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+#include <i18nutil/unicode.hxx>
#include <tools/urlobj.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
@@ -53,8 +54,8 @@
using namespace com::sun::star;
-SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs)
- : SfxTabPage(pParent, "ColorPage", "cui/ui/colorpage.ui", &rInAttrs)
+SvxColorTabPage::SvxColorTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pParent, "cui/ui/colorpage.ui", "ColorPage", &rInAttrs)
, mpTopDlg( GetParentDialog() )
, rOutAttrs ( rInAttrs )
// All the horrific pointers we store and should not
@@ -63,99 +64,98 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
, rXFSet( aXFillAttr.GetItemSet() )
, eCM( ColorModel::RGB )
, m_context(comphelper::getProcessComponentContext())
+ , m_xValSetColorList(new ColorValueSet(m_xBuilder->weld_scrolled_window("colorsetwin")))
+ , m_xValSetRecentList(new ColorValueSet(nullptr))
+ , m_xSelectPalette(m_xBuilder->weld_combo_box_text("paletteselector"))
+ , m_xRbRGB(m_xBuilder->weld_radio_button("RGB"))
+ , m_xRbCMYK(m_xBuilder->weld_radio_button("CMYK"))
+ , m_xRGBcustom(m_xBuilder->weld_widget("rgbcustom"))
+ , m_xRGBpreset(m_xBuilder->weld_widget("rgbpreset"))
+ , m_xRpreset(m_xBuilder->weld_entry("R_preset"))
+ , m_xGpreset(m_xBuilder->weld_entry("G_preset"))
+ , m_xBpreset(m_xBuilder->weld_entry("B_preset"))
+ , m_xRcustom(m_xBuilder->weld_spin_button("R_custom"))
+ , m_xGcustom(m_xBuilder->weld_spin_button("G_custom"))
+ , m_xBcustom(m_xBuilder->weld_spin_button("B_custom"))
+ , m_xHexpreset(new weld::HexColorControl(m_xBuilder->weld_entry("hex_preset")))
+ , m_xHexcustom(new weld::HexColorControl(m_xBuilder->weld_entry("hex_custom")))
+ , m_xCMYKcustom(m_xBuilder->weld_widget("cmykcustom"))
+ , m_xCMYKpreset(m_xBuilder->weld_widget("cmykpreset"))
+ , m_xCpreset(m_xBuilder->weld_entry("C_preset"))
+ , m_xYpreset(m_xBuilder->weld_entry("Y_preset"))
+ , m_xMpreset(m_xBuilder->weld_entry("M_preset"))
+ , m_xKpreset(m_xBuilder->weld_entry("K_preset"))
+ , m_xCcustom(m_xBuilder->weld_metric_spin_button("C_custom", FUNIT_PERCENT))
+ , m_xYcustom(m_xBuilder->weld_metric_spin_button("Y_custom", FUNIT_PERCENT))
+ , m_xMcustom(m_xBuilder->weld_metric_spin_button("M_custom", FUNIT_PERCENT))
+ , m_xKcustom(m_xBuilder->weld_metric_spin_button("K_custom", FUNIT_PERCENT))
+ , m_xBtnAdd(m_xBuilder->weld_button("add"))
+ , m_xBtnDelete(m_xBuilder->weld_button("delete"))
+ , m_xBtnWorkOn(m_xBuilder->weld_button("edit"))
+ , m_xCtlPreviewOld(new weld::CustomWeld(*m_xBuilder, "oldpreview", m_aCtlPreviewOld))
+ , m_xCtlPreviewNew(new weld::CustomWeld(*m_xBuilder, "newpreview", m_aCtlPreviewNew))
+ , m_xValSetColorListWin(new weld::CustomWeld(*m_xBuilder, "colorset", *m_xValSetColorList))
+ , m_xValSetRecentListWin(new weld::CustomWeld(*m_xBuilder, "recentcolorset", *m_xValSetRecentList))
{
- get(m_pSelectPalette, "paletteselector");
- get(m_pValSetColorList, "colorset");
Size aSize = LogicToPixel(Size(100 , 120), MapMode(MapUnit::MapAppFont));
- m_pValSetColorList->set_width_request(aSize.Width());
- m_pValSetColorList->set_height_request(aSize.Height());
- get(m_pValSetRecentList, "recentcolorset");
- get(m_pCtlPreviewOld, "oldpreview");
- get(m_pCtlPreviewNew, "newpreview");
+ m_xValSetColorList->set_size_request(aSize.Width(), aSize.Height());
aSize = LogicToPixel(Size(34 , 25), MapMode(MapUnit::MapAppFont));
- m_pCtlPreviewOld->set_width_request(aSize.Width());
- m_pCtlPreviewOld->set_height_request(aSize.Height());
- m_pCtlPreviewNew->set_width_request(aSize.Width());
- m_pCtlPreviewNew->set_height_request(aSize.Height());
- get(m_pRbRGB, "RGB");
- get(m_pRbCMYK, "CMYK");
- get(m_pRGBcustom, "rgbcustom");
- get(m_pRGBpreset, "rgbpreset");
- get(m_pRcustom, "R_custom");
- get(m_pRpreset, "R_preset-nospin");
- get(m_pGcustom, "G_custom");
- get(m_pGpreset, "G_preset-nospin");
- get(m_pBcustom, "B_custom");
- get(m_pBpreset, "B_preset-nospin");
- get(m_pHexpreset, "hex_preset");
- get(m_pHexcustom, "hex_custom");
- get(m_pCMYKcustom, "cmykcustom");
- get(m_pCMYKpreset, "cmykpreset");
- get(m_pCcustom, "C_custom");
- get(m_pCpreset, "C_preset-nospin");
- get(m_pYcustom, "Y_custom");
- get(m_pYpreset, "Y_preset-nospin");
- get(m_pMcustom, "M_custom");
- get(m_pMpreset, "M_preset-nospin");
- get(m_pKcustom, "K_custom");
- get(m_pKpreset, "K_preset-nospin");
- get(m_pBtnAdd, "add");
- get(m_pBtnDelete, "delete");
- get(m_pBtnWorkOn, "edit");
-
+ m_aCtlPreviewOld.set_size_request(aSize.Width(), aSize.Height());
+ m_aCtlPreviewNew.set_size_request(aSize.Width(), aSize.Height());
// this page needs ExchangeSupport
SetExchangeSupport();
// setting the output device
rXFSet.Put( XFillStyleItem(drawing::FillStyle_SOLID) );
rXFSet.Put( XFillColorItem(OUString(), COL_BLACK) );
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+ m_aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
// set handler
- m_pSelectPalette->SetSelectHdl( LINK(this, SvxColorTabPage, SelectPaletteLBHdl) );
- Link<ValueSet*, void> aValSelectLink = LINK( this, SvxColorTabPage, SelectValSetHdl_Impl );
- m_pValSetColorList->SetSelectHdl( aValSelectLink );
- m_pValSetRecentList->SetSelectHdl( aValSelectLink );
-
- Link<Edit&,void> aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl );
- m_pRcustom->SetModifyHdl( aLink );
- m_pGcustom->SetModifyHdl( aLink );
- m_pBcustom->SetModifyHdl( aLink );
- m_pHexpreset->SetModifyHdl( aLink );
- m_pHexcustom->SetModifyHdl( aLink );
- m_pCcustom->SetModifyHdl( aLink );
- m_pYcustom->SetModifyHdl( aLink );
- m_pMcustom->SetModifyHdl( aLink );
- m_pKcustom->SetModifyHdl( aLink );
-
- Link<RadioButton&,void> aLink2 = LINK( this, SvxColorTabPage, SelectColorModeHdl_Impl );
- m_pRbRGB->SetToggleHdl( aLink2 );
- m_pRbCMYK->SetToggleHdl( aLink2 );
+ m_xSelectPalette->connect_changed(LINK(this, SvxColorTabPage, SelectPaletteLBHdl));
+ Link<SvtValueSet*, void> aValSelectLink = LINK(this, SvxColorTabPage, SelectValSetHdl_Impl);
+ m_xValSetColorList->SetSelectHdl(aValSelectLink);
+ m_xValSetRecentList->SetSelectHdl(aValSelectLink);
+
+ Link<weld::SpinButton&,void> aSpinLink = LINK(this, SvxColorTabPage, SpinValueHdl_Impl);
+ m_xRcustom->connect_value_changed(aSpinLink);
+ m_xGcustom->connect_value_changed(aSpinLink);
+ m_xBcustom->connect_value_changed(aSpinLink);
+ Link<weld::Entry&,void> aEntryLink = LINK(this, SvxColorTabPage, ModifiedHdl_Impl);
+ m_xHexcustom->connect_changed(aEntryLink);
+ Link<weld::MetricSpinButton&,void> aMetricSpinLink = LINK(this, SvxColorTabPage, MetricSpinValueHdl_Impl);
+ m_xCcustom->connect_value_changed(aMetricSpinLink);
+ m_xYcustom->connect_value_changed(aMetricSpinLink);
+ m_xMcustom->connect_value_changed(aMetricSpinLink);
+ m_xKcustom->connect_value_changed(aMetricSpinLink);
+
+ Link<weld::ToggleButton&,void> aLink2 = LINK( this, SvxColorTabPage, SelectColorModeHdl_Impl );
+ m_xRbRGB->connect_toggled(aLink2);
+ m_xRbCMYK->connect_toggled(aLink2);
SetColorModel( eCM );
ChangeColorModel();
- m_pBtnAdd->SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) );
- m_pBtnWorkOn->SetClickHdl( LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
- m_pBtnDelete->SetClickHdl( LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
+ m_xBtnAdd->connect_clicked( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) );
+ m_xBtnWorkOn->connect_clicked( LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
+ m_xBtnDelete->connect_clicked( LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
// disable modify buttons
// Color palettes can't be modified
- m_pBtnDelete->Disable();
+ m_xBtnDelete->set_sensitive(false);
// disable preset color values
- m_pRGBpreset->Disable();
- m_pCMYKpreset->Disable();
+ m_xRGBpreset->set_sensitive(false);
+ m_xCMYKpreset->set_sensitive(false);
// ValueSet
- m_pValSetColorList->SetStyle( m_pValSetColorList->GetStyle() | WB_ITEMBORDER );
- m_pValSetColorList->Show();
+ m_xValSetColorList->SetStyle(m_xValSetColorList->GetStyle() | WB_ITEMBORDER);
+ m_xValSetColorList->Show();
+
+ m_xValSetRecentList->SetStyle(m_xValSetRecentList->GetStyle() | WB_ITEMBORDER);
+ m_xValSetRecentList->Show();
- m_pValSetRecentList->SetStyle( m_pValSetColorList->GetStyle() | WB_ITEMBORDER );
- m_pValSetRecentList->Show();
- maPaletteManager.ReloadRecentColorSet( *m_pValSetRecentList );
- aSize = m_pValSetRecentList->layoutAllVisible(maPaletteManager.GetRecentColorCount());
- m_pValSetRecentList->set_height_request(aSize.Height());
- m_pValSetRecentList->set_width_request(aSize.Width());
+ maPaletteManager.ReloadRecentColorSet(*m_xValSetRecentList);
+ aSize = m_xValSetRecentList->layoutAllVisible(maPaletteManager.GetRecentColorCount());
+ m_xValSetRecentList->set_size_request(aSize.Width(), aSize.Height());
}
SvxColorTabPage::~SvxColorTabPage()
@@ -166,36 +166,8 @@ SvxColorTabPage::~SvxColorTabPage()
void SvxColorTabPage::dispose()
{
mpTopDlg.clear();
- m_pSelectPalette.clear();
- m_pValSetColorList.clear();
- m_pValSetRecentList.clear();
- m_pCtlPreviewOld.clear();
- m_pCtlPreviewNew.clear();
- m_pRbRGB.clear();
- m_pRbCMYK.clear();
- m_pRGBcustom.clear();
- m_pRGBpreset.clear();
- m_pRcustom.clear();
- m_pRpreset.clear();
- m_pGcustom.clear();
- m_pGpreset.clear();
- m_pBcustom.clear();
- m_pBpreset.clear();
- m_pHexpreset.clear();
- m_pHexcustom.clear();
- m_pCMYKcustom.clear();
- m_pCMYKpreset.clear();
- m_pCcustom.clear();
- m_pCpreset.clear();
- m_pYcustom.clear();
- m_pYpreset.clear();
- m_pMcustom.clear();
- m_pMpreset.clear();
- m_pKcustom.clear();
- m_pKpreset.clear();
- m_pBtnAdd.clear();
- m_pBtnDelete.clear();
- m_pBtnWorkOn.clear();
+ m_xValSetRecentList.reset();
+ m_xValSetColorList.reset();
SfxTabPage::dispose();
}
@@ -203,23 +175,23 @@ void SvxColorTabPage::ImpColorCountChanged()
{
if (!pColorList.is())
return;
- m_pValSetColorList->SetColCount(SvxColorValueSet::getColumnCount());
- m_pValSetRecentList->SetColCount(SvxColorValueSet::getColumnCount());
+ m_xValSetColorList->SetColCount(SvxColorValueSet::getColumnCount());
+ m_xValSetRecentList->SetColCount(SvxColorValueSet::getColumnCount());
}
void SvxColorTabPage::FillPaletteLB()
{
- m_pSelectPalette->Clear();
+ m_xSelectPalette->clear();
std::vector<OUString> aPaletteList = maPaletteManager.GetPaletteList();
for (auto const& palette : aPaletteList)
{
- m_pSelectPalette->InsertEntry(palette);
+ m_xSelectPalette->append_text(palette);
}
OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() );
- m_pSelectPalette->SelectEntry(aPaletteName);
- if (m_pSelectPalette->GetSelectedEntryPos() != LISTBOX_ENTRY_NOTFOUND)
+ m_xSelectPalette->set_active_text(aPaletteName);
+ if (m_xSelectPalette->get_active() != -1)
{
- SelectPaletteLBHdl( *m_pSelectPalette );
+ SelectPaletteLBHdl(*m_xSelectPalette);
}
}
@@ -247,15 +219,15 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
sal_Int32 nPos = FindInPalette( aColor );
if ( nPos != -1 )
- m_pValSetColorList->SelectItem( m_pValSetColorList->GetItemId( nPos ) );
+ m_xValSetColorList->SelectItem(m_xValSetColorList->GetItemId(nPos));
// else search in other palettes?
}
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewOld->Invalidate();
+ m_aCtlPreviewOld.SetAttributes(aXFillAttr.GetItemSet());
+ m_aCtlPreviewOld.Invalidate();
- SelectValSetHdl_Impl( m_pValSetColorList );
+ SelectValSetHdl_Impl(m_xValSetColorList.get());
}
}
@@ -267,7 +239,6 @@ DeactivateRC SvxColorTabPage::DeactivatePage( SfxItemSet* _pSet )
return DeactivateRC::LeavePage;
}
-
bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
{
maPaletteManager.AddRecentColor( aCurrentColor, OUString() );
@@ -279,7 +250,7 @@ bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
void SvxColorTabPage::UpdateModified()
{
bool bEnable = pColorList.is() && pColorList->Count();
- m_pBtnWorkOn->Enable( bEnable );
+ m_xBtnWorkOn->set_sensitive(bEnable);
}
void SvxColorTabPage::Reset( const SfxItemSet* rSet )
@@ -306,48 +277,53 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
UpdateModified();
}
-
-VclPtr<SfxTabPage> SvxColorTabPage::Create( TabPageParent pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxColorTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
- return VclPtr<SvxColorTabPage>::Create( pWindow.pParent, *rOutAttrs );
+ return VclPtr<SvxColorTabPage>::Create(pParent, *rOutAttrs);
}
// is called when the content of the MtrFields is changed for color values
-IMPL_LINK(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
+IMPL_LINK_NOARG(SvxColorTabPage, SpinValueHdl_Impl, weld::SpinButton&, void)
{
- if (eCM == ColorModel::RGB)
- {
- // read current MtrFields, if cmyk, then k-value as transparency
- if(&rEdit == m_pHexcustom)
- aCurrentColor = m_pHexcustom->GetColor();
- else
- {
- aCurrentColor = Color( static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pRcustom->GetValue()) )),
- static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pGcustom->GetValue()) )),
- static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pBcustom->GetValue()) )) );
+ // read current MtrFields, if cmyk, then k-value as transparency
+ aCurrentColor = Color(static_cast<sal_uInt8>(PercentToColor_Impl(m_xRcustom->get_value())),
+ static_cast<sal_uInt8>(PercentToColor_Impl(m_xGcustom->get_value())),
+ static_cast<sal_uInt8>(PercentToColor_Impl(m_xBcustom->get_value())));
+ UpdateColorValues();
- }
- UpdateColorValues();
- }
- else
- {
- // read current MtrFields, if cmyk, then k-value as transparency
- aCurrentColor = Color( static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pKcustom->GetValue()) )),
- static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pCcustom->GetValue()) )),
- static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pYcustom->GetValue()) )),
- static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pMcustom->GetValue()) )) );
- ConvertColorValues (aCurrentColor, ColorModel::RGB);
- }
+ rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
+
+ m_aCtlPreviewNew.Invalidate();
+}
+
+IMPL_LINK_NOARG(SvxColorTabPage, MetricSpinValueHdl_Impl, weld::MetricSpinButton&, void)
+{
+ // read current MtrFields, if cmyk, then k-value as transparency
+ aCurrentColor = Color(static_cast<sal_uInt8>(PercentToColor_Impl(m_xKcustom->get_value(FUNIT_NONE))),
+ static_cast<sal_uInt8>(PercentToColor_Impl(m_xCcustom->get_value(FUNIT_NONE))),
+ static_cast<sal_uInt8>(PercentToColor_Impl(m_xYcustom->get_value(FUNIT_NONE))),
+ static_cast<sal_uInt8>(PercentToColor_Impl(m_xMcustom->get_value(FUNIT_NONE))));
+ ConvertColorValues (aCurrentColor, ColorModel::RGB);
rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->Invalidate();
+ m_aCtlPreviewNew.Invalidate();
}
+IMPL_LINK_NOARG(SvxColorTabPage, ModifiedHdl_Impl, weld::Entry&, void)
+{
+ aCurrentColor = m_xHexcustom->GetColor();
+ UpdateColorValues();
+
+ rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
+ m_aCtlPreviewNew.Invalidate();
+}
+
+IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void)
{
OUString aNewName( SvxResId( RID_SVXSTR_COLOR ) );
OUString aDesc( CuiResId( RID_SVXSTR_DESC_COLOR ) );
@@ -387,8 +363,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
if (!nError)
{
- m_pSelectPalette->SelectEntryPos(0);
- SelectPaletteLBHdl( *m_pSelectPalette );
+ m_xSelectPalette->set_active(0);
+ SelectPaletteLBHdl(*m_xSelectPalette);
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));
css::uno::Sequence< sal_Int32 > aCustomColorList(officecfg::Office::Common::UserColors::CustomColor::get());
css::uno::Sequence< OUString > aCustomColorNameList(officecfg::Office::Common::UserColors::CustomColorName::get());
@@ -400,17 +376,17 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
officecfg::Office::Common::UserColors::CustomColor::set(aCustomColorList, batch);
officecfg::Office::Common::UserColors::CustomColorName::set(aCustomColorNameList, batch);
batch->commit();
- sal_uInt16 nId = m_pValSetColorList->GetItemId(nSize - 1);
- m_pValSetColorList->InsertItem( nId + 1 , aCurrentColor, aName );
- m_pValSetColorList->SelectItem( nId + 1 );
- m_pBtnDelete->Enable();
+ sal_uInt16 nId = m_xValSetColorList->GetItemId(nSize - 1);
+ m_xValSetColorList->InsertItem( nId + 1 , aCurrentColor, aName );
+ m_xValSetColorList->SelectItem( nId + 1 );
+ m_xBtnDelete->set_sensitive(false);
ImpColorCountChanged();
}
UpdateModified();
}
-IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, weld::Button&, void)
{
std::unique_ptr<SvColorDialog> pColorDlg(new SvColorDialog( GetParentDialog() ));
@@ -424,18 +400,18 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, Button*, void)
UpdateColorValues( false );
// fill ItemSet and pass it on to XOut
rXFSet.Put( XFillColorItem( OUString(), aPreviewColor ) );
- //m_pCtlPreviewOld->SetAttributes( aXFillAttr );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+ //m_aCtlPreviewOld.SetAttributes( aXFillAttr );
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->Invalidate();
+ m_aCtlPreviewNew.Invalidate();
}
}
-IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, weld::Button&, void)
{
- sal_uInt16 nId = m_pValSetColorList->GetSelectedItemId();
- size_t nPos = m_pValSetColorList->GetSelectItemPos();
- if(m_pSelectPalette->GetSelectedEntryPos() == 0 && nPos != VALUESET_ITEM_NOTFOUND )
+ sal_uInt16 nId = m_xValSetColorList->GetSelectedItemId();
+ size_t nPos = m_xValSetColorList->GetSelectItemPos();
+ if (m_xSelectPalette->get_active() == 0 && nPos != VALUESET_ITEM_NOTFOUND )
{
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));
css::uno::Sequence< sal_Int32 > aCustomColorList(officecfg::Office::Common::UserColors::CustomColor::get());
@@ -451,24 +427,24 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void)
officecfg::Office::Common::UserColors::CustomColor::set(aCustomColorList, batch);
officecfg::Office::Common::UserColors::CustomColorName::set(aCustomColorNameList, batch);
batch->commit();
- m_pValSetColorList->RemoveItem(nId);
- if(m_pValSetColorList->GetItemCount() != 0)
+ m_xValSetColorList->RemoveItem(nId);
+ if (m_xValSetColorList->GetItemCount() != 0)
{
- nId = m_pValSetColorList->GetItemId(0);
- m_pValSetColorList->SelectItem(nId);
- SelectValSetHdl_Impl( m_pValSetColorList );
+ nId = m_xValSetColorList->GetItemId(0);
+ m_xValSetColorList->SelectItem(nId);
+ SelectValSetHdl_Impl(m_xValSetColorList.get());
}
else
- m_pBtnDelete->Disable();
+ m_xBtnDelete->set_sensitive(false);
}
}
-IMPL_LINK_NOARG(SvxColorTabPage, SelectPaletteLBHdl, ListBox&, void)
+IMPL_LINK_NOARG(SvxColorTabPage, SelectPaletteLBHdl, weld::ComboBoxText&, void)
{
- m_pValSetColorList->Clear();
- sal_Int32 nPos = m_pSelectPalette->GetSelectedEntryPos();
+ m_xValSetColorList->Clear();
+ sal_Int32 nPos = m_xSelectPalette->get_active();
maPaletteManager.SetPalette( nPos );
- maPaletteManager.ReloadColorSet( *m_pValSetColorList );
+ maPaletteManager.ReloadColorSet(*m_xValSetColorList);
if(nPos != maPaletteManager.GetPaletteCount() - 1 && nPos != 0)
{
@@ -491,13 +467,13 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectPaletteLBHdl, ListBox&, void)
*pnColorListState &= ~ChangeType::MODIFIED;
}
}
- if(nPos != 0)
- m_pBtnDelete->Disable();
+ if (nPos != 0)
+ m_xBtnDelete->set_sensitive(false);
- m_pValSetColorList->Resize();
+ m_xValSetColorList->Resize();
}
-IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, ValueSet*, pValSet, void)
+IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, SvtValueSet*, pValSet, void)
{
sal_Int32 nPos = pValSet->GetSelectedItemId();
if( nPos != 0 )
@@ -505,22 +481,22 @@ IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, ValueSet*, pValSet, void)
Color aColor = pValSet->GetItemColor( nPos );
rXFSet.Put( XFillColorItem( OUString(), aColor ) );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->Invalidate();
+ m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
+ m_aCtlPreviewNew.Invalidate();
ChangeColor(aColor, false);
- if(pValSet == m_pValSetColorList)
+ if (pValSet == m_xValSetColorList.get())
{
- m_pValSetRecentList->SetNoSelection();
- if(m_pSelectPalette->GetSelectedEntryPos() == 0 && m_pValSetColorList->GetSelectedItemId() != 0)
- m_pBtnDelete->Enable();
+ m_xValSetRecentList->SetNoSelection();
+ if (m_xSelectPalette->get_active() == 0 && m_xValSetColorList->GetSelectedItemId() != 0)
+ m_xBtnDelete->set_sensitive(true);
else
- m_pBtnDelete->Disable();
+ m_xBtnDelete->set_sensitive(false);
}
- if(pValSet == m_pValSetRecentList)
+ if (pValSet == m_xValSetRecentList.get())
{
- m_pValSetColorList->SetNoSelection();
- m_pBtnDelete->Disable();
+ m_xValSetColorList->SetNoSelection();
+ m_xBtnDelete->set_sensitive(false);
}
}
}
@@ -545,11 +521,12 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
break;
}
}
-IMPL_LINK(SvxColorTabPage, SelectColorModeHdl_Impl, RadioButton&, rRadioButton, void)
+
+IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModeHdl_Impl, weld::ToggleButton&, void)
{
- if( &rRadioButton == m_pRbRGB )
+ if (m_xRbRGB->get_active())
eCM = ColorModel::RGB;
- if( &rRadioButton == m_pRbCMYK )
+ else if (m_xRbCMYK->get_active())
eCM = ColorModel::CMYK;
ChangeColorModel();
UpdateColorValues();
@@ -562,18 +539,16 @@ void SvxColorTabPage::ChangeColor(const Color &rNewColor, bool bUpdatePreset )
UpdateColorValues( bUpdatePreset );
// fill ItemSet and pass it on to XOut
rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->Invalidate();
+ m_aCtlPreviewNew.SetAttributes(aXFillAttr.GetItemSet());
+ m_aCtlPreviewNew.Invalidate();
}
void SvxColorTabPage::SetColorModel( ColorModel eModel )
{
- m_pRbRGB->SetState(false);
- m_pRbCMYK->SetState(false);
- if(eModel == ColorModel::RGB)
- m_pRbRGB->SetState(true);
- if(eModel == ColorModel::CMYK)
- m_pRbCMYK->SetState(true);
+ if (eModel == ColorModel::RGB)
+ m_xRbRGB->set_active(true);
+ else if (eModel == ColorModel::CMYK)
+ m_xRbCMYK->set_active(true);
}
void SvxColorTabPage::ChangeColorModel()
@@ -582,19 +557,19 @@ void SvxColorTabPage::ChangeColorModel()
{
case ColorModel::RGB:
{
- m_pRGBcustom->Show();
- m_pRGBpreset->Show();
- m_pCMYKcustom->Hide();
- m_pCMYKpreset->Hide();
+ m_xRGBcustom->show();
+ m_xRGBpreset->show();
+ m_xCMYKcustom->hide();
+ m_xCMYKpreset->hide();
}
break;
case ColorModel::CMYK:
{
- m_pCMYKcustom->Show();
- m_pCMYKpreset->Show();
- m_pRGBcustom->Hide();
- m_pRGBpreset->Hide();
+ m_xCMYKcustom->show();
+ m_xCMYKpreset->show();
+ m_xRGBcustom->hide();
+ m_xRGBpreset->hide();
}
break;
}
@@ -607,17 +582,21 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
ConvertColorValues (aPreviousColor, eCM );
ConvertColorValues (aCurrentColor, eCM);
- m_pCcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pMcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
- m_pYcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pKcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
+ m_xCcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetRed() ), FUNIT_PERCENT );
+ m_xMcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetBlue() ), FUNIT_PERCENT );
+ m_xYcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetGreen() ), FUNIT_PERCENT );
+ m_xKcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetTransparency() ), FUNIT_PERCENT );
if( bUpdatePreset )
{
- m_pCpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
- m_pMpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
- m_pYpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
- m_pKpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetTransparency() ) );
+ m_xCpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetRed()),
+ Application::GetSettings().GetUILanguageTag()));
+ m_xMpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetBlue()),
+ Application::GetSettings().GetUILanguageTag()));
+ m_xYpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetGreen()),
+ Application::GetSettings().GetUILanguageTag()));
+ m_xKpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetTransparency()),
+ Application::GetSettings().GetUILanguageTag()));
}
ConvertColorValues (aPreviousColor, ColorModel::RGB);
@@ -625,17 +604,17 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
}
else
{
- m_pRcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pGcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pBcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
- m_pHexcustom->SetColor( aCurrentColor );
+ m_xRcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
+ m_xGcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
+ m_xBcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+ m_xHexcustom->SetColor( aCurrentColor );
if( bUpdatePreset )
{
- m_pRpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
- m_pGpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
- m_pBpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
- m_pHexpreset->SetColor( aPreviousColor );
+ m_xRpreset->set_text(OUString::number(ColorToPercent_Impl(aPreviousColor.GetRed())));
+ m_xGpreset->set_text(OUString::number(ColorToPercent_Impl(aPreviousColor.GetGreen())));
+ m_xBpreset->set_text(OUString::number(ColorToPercent_Impl(aPreviousColor.GetBlue())));
+ m_xHexpreset->SetColor( aPreviousColor );
}
}
}
diff --git a/cui/uiconfig/ui/colorpage.ui b/cui/uiconfig/ui/colorpage.ui
index 915092fe3c89..f563456cf7e5 100644
--- a/cui/uiconfig/ui/colorpage.ui
+++ b/cui/uiconfig/ui/colorpage.ui
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <!-- interface-requires LibreOffice 1.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="step_increment">1</property>
@@ -13,6 +12,31 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="adjustment3">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment4">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment5">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment6">
+ <property name="upper">255</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment7">
+ <property name="upper">255</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -55,11 +79,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
<property name="label" translatable="yes" context="colorpage|label21">Palette:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">paletteselector</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -68,7 +92,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="paletteselector">
+ <object class="GtkComboBoxText" id="paletteselector">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -82,8 +106,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -97,10 +119,10 @@
<object class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="colorpage|label20">Recent Colors</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">recentcolorset</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -109,7 +131,7 @@
</packing>
</child>
<child>
- <object class="svxcorelo-SvxColorValueSet" id="recentcolorset">
+ <object class="GtkDrawingArea" id="recentcolorset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
@@ -125,8 +147,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -147,8 +167,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -164,8 +182,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -175,14 +191,12 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">RGB</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -195,8 +209,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -204,22 +216,19 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">3</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="colorpage|label22">Custom Palette</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -229,11 +238,25 @@
<property name="valign">start</property>
<property name="orientation">vertical</property>
<child>
- <object class="svxcorelo-SvxColorValueSet" id="colorset">
+ <object class="GtkScrolledWindow" id="colorsetwin">
<property name="visible">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>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="colorset">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -245,8 +268,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -295,7 +316,7 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="svxlo-SvxXRectPreview" id="oldpreview">
+ <object class="GtkDrawingArea" id="oldpreview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -334,13 +355,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label7">B</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">B_custom</property>
+ <property name="mnemonic_widget">B_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -349,13 +368,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label8">G</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">G_custom</property>
+ <property name="mnemonic_widget">G_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -364,13 +381,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label9">R</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">R_custom</property>
+ <property name="mnemonic_widget">R_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -378,64 +393,60 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label18">Hex</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">hex_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="svxcorelo-HexColorControl" id="hex_preset">
+ <object class="GtkEntry" id="hex_preset">
<property name="width_request">6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="editable">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="R_preset-nospin">
+ <object class="GtkEntry" id="R_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment2</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="G_preset-nospin">
+ <object class="GtkEntry" id="G_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment2</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="B_preset-nospin">
+ <object class="GtkEntry" id="B_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment2</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -459,13 +470,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label10">_C</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">C_custom:0%</property>
+ <property name="mnemonic_widget">C_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -474,13 +483,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label16">_K</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">K_custom:0%</property>
+ <property name="mnemonic_widget">K_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -489,64 +496,59 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label17">_Y</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">Y_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="C_preset-nospin:0%">
+ <object class="GtkEntry" id="C_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="M_preset-nospin:0%">
+ <object class="GtkEntry" id="M_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="Y_preset-nospin:0%">
+ <object class="GtkEntry" id="Y_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="K_preset-nospin:0%">
+ <object class="GtkEntry" id="K_preset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="editable">False</property>
+ <property name="width_chars">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -555,12 +557,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label15">_M</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">M_preset</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -617,7 +618,7 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="svxlo-SvxXRectPreview" id="newpreview">
+ <object class="GtkDrawingArea" id="newpreview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -654,28 +655,26 @@
<object class="GtkSpinButton" id="B_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="primary_icon_tooltip_text" translatable="yes" context="colorpage|B_custom">Blue</property>
- <property name="adjustment">adjustment2</property>
+ <property name="adjustment">adjustment7</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="R_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="primary_icon_tooltip_text" translatable="yes" context="colorpage|R_custom">Red</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -684,12 +683,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label4">_B</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">B_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -698,12 +696,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label3">_G</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">G_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -712,26 +709,24 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label2">_R</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">R_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="G_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="primary_icon_tooltip_text" translatable="yes" context="colorpage|G_custom">Green</property>
- <property name="adjustment">adjustment2</property>
+ <property name="adjustment">adjustment6</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -745,21 +740,18 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="svxcorelo-HexColorControl" id="hex_custom">
+ <object class="GtkEntry" id="hex_custom">
<property name="width_request">6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -784,13 +776,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label11">_C</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">C_custom:0%</property>
+ <property name="mnemonic_widget">C_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -799,12 +789,11 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label12">_M</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">M_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -813,39 +802,35 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label13">_K</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">K_custom:0%</property>
+ <property name="mnemonic_widget">K_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="C_custom:0%">
+ <object class="GtkSpinButton" id="C_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="K_custom:0%">
+ <object class="GtkSpinButton" id="K_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment5</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -854,38 +839,35 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="colorpage|label14">_Y</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">Y_custom</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="Y_custom:0%">
+ <object class="GtkSpinButton" id="Y_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment4</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="M_custom:0%">
+ <object class="GtkSpinButton" id="M_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -937,10 +919,10 @@
<widgets>
<widget name="R_custom"/>
<widget name="hex_custom"/>
- <widget name="C_custom:0%"/>
- <widget name="C_preset-nospin:0%"/>
+ <widget name="C_custom"/>
+ <widget name="C_preset"/>
<widget name="hex_preset"/>
- <widget name="R_preset-nospin"/>
+ <widget name="R_preset"/>
</widgets>
</object>
</interface>