[Libreoffice-commits] core.git: cui/source cui/uiconfig
Rishabh Kumar
kris.kr296 at gmail.com
Wed Jun 8 08:50:45 UTC 2016
cui/source/inc/cuitabarea.hxx | 43 ++-
cui/source/tabpages/tpcolor.cxx | 276 +++++++++++++----------
cui/uiconfig/ui/colorpage.ui | 477 ++++++++++++++++++++++++++++++++++------
3 files changed, 599 insertions(+), 197 deletions(-)
New commits:
commit 7b186b14ba1c1bd983798e1a987fe6310cf1b749
Author: Rishabh Kumar <kris.kr296 at gmail.com>
Date: Fri May 27 16:16:12 2016 +0530
Addition of new controls and their rearrangement in color tab
1. Addition of RGB and CMYK fields for the previous/old color.
2. Removal of color mode(RGB/CMYK) listbox and replacement with RadioButtons.
3. Changing color mode should not change the previous selected color.
4. Hide CMYK controls and color mode RadioButtons.
5. Addition of Hexadecimal color values.
Change-Id: Iafc51e750e1f08345771edc9a733b91f6c771500
Reviewed-on: https://gerrit.libreoffice.org/25538
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index adba0ba..ef0e11c 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -28,6 +28,7 @@
#include <svx/xfillit0.hxx>
#include <svx/xfillit.hxx>
#include <svx/tabarea.hxx>
+#include <svx/hexcolorcontrol.hxx>
#include <svx/SvxColorValueSet.hxx>
class SdrModel;
@@ -671,18 +672,30 @@ private:
VclPtr<SvxXRectPreview> m_pCtlPreviewOld;
VclPtr<SvxXRectPreview> m_pCtlPreviewNew;
- VclPtr<ListBox> m_pLbColorModel;
-
- VclPtr<VclContainer> m_pRGB;
- VclPtr<NumericField> m_pR;
- VclPtr<NumericField> m_pG;
- VclPtr<NumericField> m_pB;
-
- VclPtr<VclContainer> m_pCMYK;
- VclPtr<MetricField> m_pC;
- VclPtr<MetricField> m_pY;
- VclPtr<MetricField> m_pM;
- VclPtr<MetricField> m_pK;
+ 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_pBtnModify;
@@ -706,6 +719,7 @@ private:
ColorModel eCM;
+ Color aPreviousColor;
Color aCurrentColor;
static void ConvertColorValues (Color& rColor, ColorModel eModell);
@@ -724,8 +738,11 @@ private:
DECL_LINK_TYPED( SelectColorLBHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( SelectValSetHdl_Impl, ValueSet*, void );
- DECL_LINK_TYPED( SelectColorModelHdl_Impl, ListBox&, void );
+ DECL_LINK_TYPED( SelectColorModeHdl_Impl, RadioButton&, void );
void ChangeColor(const Color &rNewColor);
+ void SetColorModel(ColorModel eModel);
+ void ChangeColorModel();
+ void UpdateColorValues();
DECL_LINK_TYPED( ModifiedHdl_Impl, Edit&, void );
long CheckChanges_Impl();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 93fbf9e..c3f4a1b 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -339,16 +339,28 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
m_pCtlPreviewOld->set_height_request(aSize.Height());
m_pCtlPreviewNew->set_width_request(aSize.Width());
m_pCtlPreviewNew->set_height_request(aSize.Height());
- get(m_pLbColorModel, "modellb");
- get(m_pRGB, "rgb");
- get(m_pR, "R");
- get(m_pG, "G");
- get(m_pB, "B");
- get(m_pCMYK, "cmyk");
- get(m_pC, "C");
- get(m_pY, "Y");
- get(m_pM, "M");
- get(m_pK, "K");
+ 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_pBtnModify, "modify");
get(m_pBtnWorkOn, "edit");
@@ -376,23 +388,33 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
LINK( this, SvxColorTabPage, SelectColorLBHdl_Impl ) );
m_pValSetColorList->SetSelectHdl(
LINK( this, SvxColorTabPage, SelectValSetHdl_Impl ) );
- m_pLbColorModel->SetSelectHdl(
- LINK( this, SvxColorTabPage, SelectColorModelHdl_Impl ) );
Link<Edit&,void> aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl );
- m_pR->SetModifyHdl( aLink );
- m_pG->SetModifyHdl( aLink );
- m_pB->SetModifyHdl( aLink );
- m_pC->SetModifyHdl( aLink );
- m_pY->SetModifyHdl( aLink );
- m_pM->SetModifyHdl( aLink );
- m_pK->SetModifyHdl( aLink );
+ 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 );
+ SetColorModel( eCM );
+ ChangeColorModel();
m_pBtnAdd->SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) );
m_pBtnModify->SetClickHdl( LINK( this, SvxColorTabPage, ClickModifyHdl_Impl ) );
m_pBtnWorkOn->SetClickHdl( LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
m_pBtnDelete->SetClickHdl( LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
+ // disable preset color values
+ m_pRGBpreset->Disable();
+ m_pCMYKpreset->Disable();
+
// ValueSet
m_pValSetColorList->SetStyle( m_pValSetColorList->GetStyle() | WB_ITEMBORDER );
m_pValSetColorList->Show();
@@ -417,16 +439,28 @@ void SvxColorTabPage::dispose()
m_pValSetColorList.clear();
m_pCtlPreviewOld.clear();
m_pCtlPreviewNew.clear();
- m_pLbColorModel.clear();
- m_pRGB.clear();
- m_pR.clear();
- m_pG.clear();
- m_pB.clear();
- m_pCMYK.clear();
- m_pC.clear();
- m_pY.clear();
- m_pM.clear();
- m_pK.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_pBtnModify.clear();
m_pBtnWorkOn.clear();
@@ -467,6 +501,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 );
m_pEdtName->SetText( m_pLbColor->GetSelectEntry() );
XColorEntry* pEntry = pColorList->GetColor( *pPos );
+ aPreviousColor = pEntry->GetColor();
ChangeColor(pEntry->GetColor());
}
else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND )
@@ -474,27 +509,25 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
const SfxPoolItem* pPoolItem = nullptr;
if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
{
- m_pLbColorModel->SelectEntryPos( CM_RGB );
+ SetColorModel( CM_RGB );
+ ChangeColorModel();
- ChangeColor(static_cast<const XFillColorItem*>(pPoolItem)->GetColorValue());
+ aPreviousColor = static_cast<const XFillColorItem*>(pPoolItem)->GetColorValue();
+ ChangeColor( aPreviousColor );
m_pEdtName->SetText( static_cast<const XFillColorItem*>( pPoolItem )->GetName() );
- m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-
- // fill ItemSet and pass it on to XOut
- rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+ 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.GetColor() );
- m_pCtlPreviewNew->Invalidate();
- m_pCtlPreviewOld->Invalidate();
}
}
- // so that the possibly changed color is discarded
+ m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
+ m_pCtlPreviewOld->Invalidate();
+
SelectColorLBHdl_Impl( *m_pLbColor );
*pPageType = PT_COLOR;
@@ -624,6 +657,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
if ( nState >= SfxItemState::DEFAULT )
{
XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rSet->Get( XATTR_FILLCOLOR )) );
+ aPreviousColor = aColorItem.GetColorValue();
aNewColor = aColorItem.GetColorValue();
m_pLbColor->SelectEntry(aNewColor);
m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 );
@@ -632,12 +666,12 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
// set color model
OUString aStr = GetUserData();
- m_pLbColorModel->SelectEntryPos( aStr.toInt32() );
+ eCM = (ColorModel)aStr.toInt32();
+ SetColorModel( eCM );
+ ChangeColorModel();
ChangeColor(aNewColor);
- SelectColorModelHdl_Impl( *m_pLbColorModel );
- m_pCtlPreviewOld->Invalidate();
UpdateModified();
}
@@ -649,22 +683,29 @@ VclPtr<SfxTabPage> SvxColorTabPage::Create( vcl::Window* pWindow,
}
// is called when the content of the MtrFields is changed for color values
-IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ModifiedHdl_Impl, Edit&, void)
+IMPL_LINK_TYPED(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
{
if (eCM == CM_RGB)
{
// read current MtrFields, if cmyk, then k-value as transparency
- aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pR->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pG->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pB->GetValue() ) ).GetColor() );
+ if(&rEdit == m_pHexcustom)
+ aCurrentColor = (Color)m_pHexcustom->GetColor();
+ else
+ {
+ aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pRcustom->GetValue() ),
+ (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pGcustom->GetValue() ),
+ (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pBcustom->GetValue() ) ).GetColor() );
+
+ }
+ UpdateColorValues();
}
else
{
// read current MtrFields, if cmyk, then k-value as transparency
- aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pK->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pC->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pY->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pM->GetValue() ) ).GetColor() );
+ aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pKcustom->GetValue() ),
+ (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pCcustom->GetValue() ),
+ (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pYcustom->GetValue() ),
+ (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pMcustom->GetValue() ) ).GetColor() );
ConvertColorValues (aCurrentColor, CM_RGB);
}
@@ -837,22 +878,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickWorkOnHdl_Impl, Button*, void)
{
Color aPreviewColor = pColorDlg->GetColor();
aCurrentColor = aPreviewColor;
- if (eCM != CM_RGB)
- {
- ConvertColorValues (aCurrentColor, eCM);
- m_pC->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
- m_pK->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
- ConvertColorValues (aCurrentColor, CM_RGB);
- }
- else
- {
- m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
- }
-
+ UpdateColorValues();
// fill ItemSet and pass it on to XOut
rXFSet.Put( XFillColorItem( OUString(), aPreviewColor ) );
//m_pCtlPreviewOld->SetAttributes( aXFillAttr );
@@ -907,10 +933,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorLBHdl_Impl, ListBox&, void)
rXFSet.Put( XFillColorItem( OUString(),
m_pLbColor->GetSelectEntryColor() ) );
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
-
- m_pCtlPreviewOld->Invalidate();
m_pCtlPreviewNew->Invalidate();
XColorEntry* pEntry = pColorList->GetColor(nPos);
@@ -929,10 +952,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectValSetHdl_Impl, ValueSet*, void)
rXFSet.Put( XFillColorItem( OUString(),
m_pLbColor->GetSelectEntryColor() ) );
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
-
- m_pCtlPreviewOld->Invalidate();
m_pCtlPreviewNew->Invalidate();
XColorEntry* pEntry = pColorList->GetColor(nPos-1);
@@ -961,66 +981,92 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
break;
}
}
-
-IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorModelHdl_Impl, ListBox&, void)
+IMPL_LINK_TYPED(SvxColorTabPage, SelectColorModeHdl_Impl, RadioButton&, rRadioButton, void)
{
- int nPos = m_pLbColorModel->GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- eCM = (ColorModel) nPos;
+ if( &rRadioButton == m_pRbRGB )
+ eCM = CM_RGB;
+ if( &rRadioButton == m_pRbCMYK )
+ eCM = CM_CMYK;
+ ChangeColorModel();
+ UpdateColorValues();
+}
- switch( eCM )
- {
- case CM_RGB:
- {
- m_pRGB->Show();
- m_pCMYK->Hide();
+void SvxColorTabPage::ChangeColor(const Color &rNewColor)
+{
+ aCurrentColor = rNewColor;
+ UpdateColorValues();
+ // fill ItemSet and pass it on to XOut
+ rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
+ m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+ m_pCtlPreviewNew->Invalidate();
+}
- }
- break;
+void SvxColorTabPage::SetColorModel( ColorModel eModel )
+{
+ m_pRbRGB->SetState(false);
+ m_pRbCMYK->SetState(false);
+ if(eModel == CM_RGB)
+ m_pRbRGB->SetState(true);
+ if(eModel == CM_CMYK)
+ m_pRbCMYK->SetState(true);
+}
- case CM_CMYK:
- {
- m_pCMYK->Show();
- m_pRGB->Hide();
- }
- break;
+void SvxColorTabPage::ChangeColorModel()
+{
+ switch( eCM )
+ {
+ case CM_RGB:
+ {
+ m_pRGBcustom->Show();
+ m_pRGBpreset->Show();
+ m_pCMYKcustom->Hide();
+ m_pCMYKpreset->Hide();
}
+ break;
- ChangeColor(aCurrentColor);
-
+ case CM_CMYK:
+ {
+ m_pCMYKcustom->Show();
+ m_pCMYKpreset->Show();
+ m_pRGBcustom->Hide();
+ m_pRGBpreset->Hide();
+ }
+ break;
}
}
-
-void SvxColorTabPage::ChangeColor(const Color &rNewColor)
+void SvxColorTabPage::UpdateColorValues()
{
- aCurrentColor = rNewColor;
if (eCM != CM_RGB)
{
+ ConvertColorValues (aPreviousColor, eCM );
ConvertColorValues (aCurrentColor, eCM);
- m_pC->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
- m_pK->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
+
+ m_pCcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
+ m_pCpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
+ m_pYcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
+ m_pYpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
+ m_pMcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+ m_pMpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
+ m_pKcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
+ m_pKpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetTransparency() ) );
+
+ ConvertColorValues (aPreviousColor, CM_RGB);
ConvertColorValues (aCurrentColor, CM_RGB);
}
else
{
- m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
- m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
- m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+ m_pRcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
+ m_pRpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
+ m_pGcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
+ m_pGpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
+ m_pBcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+ m_pBpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
+ m_pHexcustom->SetColor( aCurrentColor.GetColor() );
+ m_pHexpreset->SetColor( aPreviousColor.GetColor() );
}
-
- // fill ItemSet and pass it on to XOut
- rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
- m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
- m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
-
- m_pCtlPreviewNew->Invalidate();
}
-
//void SvxColorTabPage::FillValueSet_Impl( ValueSet& rVs )
//{
// long nCount = pColorList->Count();
diff --git a/cui/uiconfig/ui/colorpage.ui b/cui/uiconfig/ui/colorpage.ui
index c620ade..fdc3156 100644
--- a/cui/uiconfig/ui/colorpage.ui
+++ b/cui/uiconfig/ui/colorpage.ui
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <!-- interface-requires LibreOffice 1.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="step_increment">1</property>
@@ -72,6 +72,8 @@
<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>
@@ -86,6 +88,8 @@
<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>
@@ -99,6 +103,8 @@
<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>
@@ -110,6 +116,8 @@
<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>
@@ -128,6 +136,8 @@
<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>
@@ -140,12 +150,16 @@
<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>
<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>
@@ -168,61 +182,77 @@
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="svxlo-SvxXRectPreview" id="oldpreview">
+ <object class="svxlo-SvxXRectPreview" id="newpreview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="accessible">
- <object class="AtkObject" id="oldpreview-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Old Color</property>
+ <object class="AtkObject" id="newpreview-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">New Color</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <object class="svxlo-SvxXRectPreview" id="newpreview">
+ <object class="svxlo-SvxXRectPreview" id="oldpreview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="accessible">
- <object class="AtkObject" id="newpreview-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">New Color</property>
+ <object class="AtkObject" id="oldpreview-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Old Color</property>
</object>
</child>
</object>
<packing>
- <property name="left_attach">1</property>
+ <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>
- <object class="GtkComboBoxText" id="modellb">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">end</property>
- <items>
- <item translatable="yes">RGB</item>
- <item translatable="yes">CMYK</item>
- </items>
- <child internal-child="accessible">
- <object class="AtkObject" id="modellb-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Color Mode</property>
- </object>
- </child>
+ <object class="GtkRadioButton" id="RGB">
+ <property name="label" translatable="yes">RGB</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</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="GtkRadioButton" id="CMYK">
+ <property name="label" translatable="yes">CMYK</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="rgb">
+ <object class="GtkGrid" id="rgbcustom">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
@@ -231,7 +261,7 @@
<property name="column_spacing">6</property>
<property name="row_homogeneous">True</property>
<child>
- <object class="GtkSpinButton" id="B">
+ <object class="GtkSpinButton" id="B_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
@@ -240,22 +270,12 @@
<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="G">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="adjustment">adjustment2</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="R">
+ <object class="GtkSpinButton" id="R_custom">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
@@ -264,6 +284,8 @@
<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>
@@ -272,11 +294,13 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_B</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">B</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>
@@ -285,11 +309,13 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_G</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">G</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>
@@ -298,22 +324,65 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_R</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">R</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="invisible_char">•</property>
+ <property name="adjustment">adjustment2</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="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Hex</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="cuilo-HexColorControl" id="hex_custom">
+ <property name="width_request">6</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">2</property>
+ <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="GtkGrid" id="cmyk">
+ <object class="GtkGrid" id="cmykcustom">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
@@ -327,11 +396,13 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_C</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">C:0%</property>
+ <property name="mnemonic_widget">C_custom:0%</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>
@@ -340,11 +411,12 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_M</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">M:0%</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>
@@ -353,15 +425,17 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_K</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">K:0%</property>
+ <property name="mnemonic_widget">K_custom:0%</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:0%">
+ <object class="GtkSpinButton" id="C_custom:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
@@ -370,10 +444,12 @@
<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:0%">
+ <object class="GtkSpinButton" id="K_custom:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
@@ -381,11 +457,27 @@
</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="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Y</property>
+ <property name="use_underline">True</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="K:0%">
+ <object class="GtkSpinButton" id="M_custom:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
@@ -393,39 +485,157 @@
</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_custom:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">adjustment1</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>
+ <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="GtkGrid" id="cmykpreset">
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_C</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">C_custom:0%</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="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_M</property>
+ <property name="use_underline">True</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>
+ <object class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_K</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">K_custom:0%</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="GtkLabel" id="label14">
+ <object class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Y</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">Y:0%</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:0%">
+ <object class="GtkSpinButton" id="C_preset-nospin:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">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="M_preset-nospin:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
<property name="adjustment">adjustment1</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%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</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%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</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>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
- <property name="width">2</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -438,17 +648,137 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
+ <object class="GtkGrid" id="rgbpreset">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">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>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">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>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">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="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Hex</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">
+ <property name="width_request">6</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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>
+ <child>
+ <object class="GtkSpinButton" id="R_preset-nospin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</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>
+ <object class="GtkSpinButton" id="G_preset-nospin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment2</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">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment2</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>
+ <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>
<placeholder/>
@@ -531,6 +861,8 @@
<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>
@@ -549,6 +881,8 @@
<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>
</object>
@@ -576,6 +910,8 @@
<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>
</object>
@@ -617,9 +953,12 @@
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
- <widget name="modellb"/>
- <widget name="R"/>
- <widget name="C:0%"/>
+ <widget name="R_custom"/>
+ <widget name="hex_custom"/>
+ <widget name="C_custom:0%"/>
+ <widget name="C_preset-nospin:0%"/>
+ <widget name="hex_preset"/>
+ <widget name="R_preset-nospin"/>
</widgets>
</object>
</interface>
More information about the Libreoffice-commits
mailing list