[Libreoffice-commits] core.git: Branch 'feature/sidebar' - svx/source
Andre Fischer
af at apache.org
Fri May 10 01:47:00 PDT 2013
svx/source/sidebar/PanelFactory.cxx | 2
svx/source/sidebar/text/TextPropertyPanel.cxx | 74 +++++---------------------
svx/source/sidebar/text/TextPropertyPanel.hxx | 7 --
svx/source/sidebar/text/TextPropertyPanel.src | 36 ++++++++----
4 files changed, 43 insertions(+), 76 deletions(-)
New commits:
commit 244863b423f9eb77b22b544ba17b15ba96c305fd
Author: Andre Fischer <af at apache.org>
Date: Mon Apr 29 08:34:09 2013 +0000
Resolved: #i122186# Rearranged controls in text property panel...
to make font selection box wider.
(cherry picked from commit 4484a62e0365fc36cc2a9e3ad1c71749d260d4d0)
Change-Id: I4a189c106b497da36e3ad0d13a8e6087b95e73c2
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index 6073850..cb02d67 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -134,7 +134,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s))
if (DoesResourceEndWith("/TextPropertyPanel"))
{
- pControl = TextPropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar);
+ pControl = TextPropertyPanel::Create(pParentWindow, xFrame, pBindings);
}
else if (DoesResourceEndWith("/ParaPropertyPanel"))
{
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 7534361..481184a 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -68,7 +68,6 @@ namespace svx { namespace sidebar {
#undef HAS_IA2
-#define TEXT_SECTIONPAGE_HEIGHT_S SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) + CONTROL_SPACING_VERTICAL * 1 + SECTIONPAGE_MARGIN_VERTICAL_BOT
#define TEXT_SECTIONPAGE_HEIGHT SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
//
@@ -135,8 +134,7 @@ long TextPropertyPanel::GetSelFontSize()
TextPropertyPanel* TextPropertyPanel::Create (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const cssu::Reference<css::ui::XSidebar>& rxSidebar)
+ SfxBindings* pBindings)
{
if (pParent == NULL)
throw lang::IllegalArgumentException(A2S("no parent Window given to TextPropertyPanel::Create"), NULL, 0);
@@ -148,8 +146,7 @@ TextPropertyPanel* TextPropertyPanel::Create (
return new TextPropertyPanel(
pParent,
rxFrame,
- pBindings,
- rxSidebar);
+ pBindings);
}
@@ -161,8 +158,7 @@ TextPropertyPanel* TextPropertyPanel::Create (
TextPropertyPanel::TextPropertyPanel (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const cssu::Reference<css::ui::XSidebar>& rxSidebar)
+ SfxBindings* pBindings)
: Control(pParent, SVX_RES(RID_SIDEBAR_TEXT_PANEL)),
mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))),
maFontSizeBox (this, SVX_RES(MB_SBFONT_FONTSIZE)),
@@ -225,8 +221,7 @@ TextPropertyPanel::TextPropertyPanel (
mxFrame(rxFrame),
maContext(),
- mpBindings(pBindings),
- mxSidebar(rxSidebar)
+ mpBindings(pBindings)
{
Initialize();
FreeResource();
@@ -282,57 +277,36 @@ void TextPropertyPanel::HandleContextChange (
{
case CombinedEnumContext(Application_Calc, Context_Cell):
case CombinedEnumContext(Application_Calc, Context_Pivot):
- {
- mpToolBoxScript->Hide();
mpToolBoxScriptSw->Hide();
- mpToolBoxSpacing->Hide();
mpToolBoxHighlight->Hide();
+ mpToolBoxScript->Disable();
+ mpToolBoxSpacing->Disable();
+ break;
- Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT_S);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
- if (mxSidebar.is())
- mxSidebar->requestLayout();
+ case CombinedEnumContext(Application_Calc, Context_EditCell):
+ case CombinedEnumContext(Application_Calc, Context_DrawText):
+ mpToolBoxScriptSw->Hide();
+ mpToolBoxHighlight->Hide();
+ mpToolBoxScript->Enable();
+ mpToolBoxSpacing->Enable();
break;
- }
case CombinedEnumContext(Application_WriterVariants, Context_Text):
case CombinedEnumContext(Application_WriterVariants, Context_Table):
- {
mpToolBoxScriptSw->Show();
mpToolBoxScript->Hide();
mpToolBoxHighlight->Show();
mpToolBoxSpacing->Show();
-
- Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
- if (mxSidebar.is())
- mxSidebar->requestLayout();
break;
- }
case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
- {
mpToolBoxScriptSw->Show();
mpToolBoxScript->Hide();
mpToolBoxSpacing->Show();
mpToolBoxHighlight->Hide();
-
- Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
- if (mxSidebar.is())
- mxSidebar->requestLayout();
break;
- }
- case CombinedEnumContext(Application_Calc, Context_EditCell):
- case CombinedEnumContext(Application_Calc, Context_DrawText):
case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
case CombinedEnumContext(Application_DrawImpress, Context_Text):
case CombinedEnumContext(Application_DrawImpress, Context_Table):
@@ -340,20 +314,11 @@ void TextPropertyPanel::HandleContextChange (
case CombinedEnumContext(Application_DrawImpress, Context_Draw):
case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
- {
mpToolBoxScriptSw->Hide();
mpToolBoxScript->Show();
mpToolBoxSpacing->Show();
mpToolBoxHighlight->Hide();
-
- Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
- if (mxSidebar.is())
- mxSidebar->requestLayout();
break;
- }
default:
break;
@@ -464,15 +429,10 @@ void TextPropertyPanel::Initialize (void)
aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
maFontSizeBox.SetLoseFocusHdl(aLink);
- // add
- long aSizeBoxHeight = maFontSizeBox.GetSizePixel().getHeight();;
- Point aPosFontSize = maFontSizeBox.GetPosPixel();
- long aPosY = aPosFontSize.getY();
- Point pTBIncDec = mpToolBoxIncDec->GetPosPixel();
- long aIncDecHeight = mpToolBoxIncDec->GetSizePixel().getHeight();
- pTBIncDec.setY(aPosY+aSizeBoxHeight/2-aIncDecHeight/2);
- mpToolBoxIncDec->SetPosPixel(pTBIncDec);
- //end
+ Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
+ aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
+ aSize.setWidth(GetOutputSizePixel().Width());
+ SetSizePixel(aSize);
}
void TextPropertyPanel::EndSpacingPopupMode (void)
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index b5ad01b..ea21f67 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -55,8 +55,7 @@ public:
static TextPropertyPanel* Create (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const cssu::Reference<css::ui::XSidebar>& rxSidebar);
+ SfxBindings* pBindings);
virtual void DataChanged (const DataChangedEvent& rEvent);
::sfx2::sidebar::ControllerItem& GetSpaceController();
@@ -159,13 +158,11 @@ private:
cssu::Reference<css::frame::XFrame> mxFrame;
::sfx2::sidebar::EnumContext maContext;
SfxBindings* mpBindings;
- cssu::Reference<css::ui::XSidebar> mxSidebar;
TextPropertyPanel (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const cssu::Reference<css::ui::XSidebar>& rxSidebar);
+ SfxBindings* pBindings);
virtual ~TextPropertyPanel (void);
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index 3197bbc..cd5ce56 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -21,8 +21,8 @@
#define CONTROL_HEIGHT_FONT_NAME 250
#define CONTROL_HEIGHT_FONT_SIZE 180
-#define FONTNAME_WIDTH TOOLBOX_ITEM_WIDTH * 2 + TOOLBOX_ITEM_DD_WIDTH
-#define FONTSIZE_WIDTH TOOLBOX_ITEM_WIDTH * 2
+#define FONTSIZE_WIDTH (TOOLBOX_ITEM_WIDTH * 2 - 1)
+#define FONTNAME_WIDTH (PROPERTYPAGE_WIDTH - (FONTSIZE_WIDTH) - 6)
#define TB_SPACE 18
#define TB_SPACE_V 4
@@ -31,6 +31,16 @@
#define FT_TB_SPACE 1
#define BK_IMG 20
+#define X0 SECTIONPAGE_MARGIN_HORIZONTAL
+#define X1 SECTIONPAGE_MARGIN_HORIZONTAL + 1 + TOOLBOX_ITEM_WIDTH * 2 + 4
+#define X2 (PROPERTYPAGE_WIDTH - (FONTSIZE_WIDTH))
+#define X3 (X2 - (TOOLBOX_ITEM_DD_WIDTH) - 2)
+
+#define FIRST_LINE_Y SECTIONPAGE_MARGIN_VERTICAL_TOP
+#define SECOND_LINE_Y FIRST_LINE_Y + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 1
+#define THIRD_LINE_Y SECOND_LINE_Y + CONTROL_SPACING_VERTICAL + (TOOLBOX_ITEM_HEIGHT + 2)
+
+
Control RID_SIDEBAR_TEXT_PANEL
{
OutputSize = TRUE;
@@ -44,8 +54,8 @@ Control RID_SIDEBAR_TEXT_PANEL
ComboBox CB_SBFONT_FONT
{
Border = TRUE;
- Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL , SECTIONPAGE_MARGIN_VERTICAL_TOP );
- Size = MAP_APPFONT ( FONTNAME_WIDTH , CONTROL_HEIGHT_FONT_NAME );
+ Pos = MAP_APPFONT (X0 , FIRST_LINE_Y);
+ Size = MAP_APPFONT (FONTNAME_WIDTH , CONTROL_HEIGHT_FONT_NAME);
TabStop = TRUE;
DropDown = TRUE;
HelpID = HID_COMBO_FONT_NAME ;
@@ -54,8 +64,8 @@ Control RID_SIDEBAR_TEXT_PANEL
MetricBox MB_SBFONT_FONTSIZE
{
Border = TRUE;
- Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL + FONTNAME_WIDTH + 2, SECTIONPAGE_MARGIN_VERTICAL_TOP);
- Size = MAP_APPFONT ( FONTSIZE_WIDTH - 1, CONTROL_HEIGHT_FONT_SIZE );
+ Pos = MAP_APPFONT (X2, FIRST_LINE_Y);
+ Size = MAP_APPFONT (FONTSIZE_WIDTH, CONTROL_HEIGHT_FONT_SIZE);
TabStop = TRUE;
DropDown = TRUE;
HelpID = HID_METRIC_FONT_SIZE;
@@ -65,7 +75,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_INCREASE_DECREASE
{
SVLook = TRUE ;
- Pos = MAP_APPFONT ( PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2, SECTIONPAGE_MARGIN_VERTICAL_TOP) ;
+ Pos = MAP_APPFONT (X2, SECOND_LINE_Y) ;
Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONTSIZE_INDE;
@@ -87,7 +97,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_FONT
{
SVLook = TRUE ;
- Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1, SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 1) ;
+ Pos = MAP_APPFONT (X0 + 1, SECOND_LINE_Y) ;
Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 4 + TOOLBOX_ITEM_DD_WIDTH, TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT;
@@ -127,7 +137,7 @@ Control RID_SIDEBAR_TEXT_PANEL
{
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT_COLOR;
SVLook = TRUE ;
- Pos = MAP_APPFONT (PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2, SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 1) ;
+ Pos = MAP_APPFONT (X3, THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
Text = "Font Color" ;
@@ -145,7 +155,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_HIGHLIGHT
{
SVLook = TRUE ;
- Pos = MAP_APPFONT (PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + (TOOLBOX_ITEM_HEIGHT + 2) + CONTROL_SPACING_VERTICAL * 2 + 1) ;
+ Pos = MAP_APPFONT (X2, THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_HIGHLIGHT_COLOR;
@@ -164,7 +174,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_SCRIPT_SW
{
SVLook = TRUE ;
- Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + (TOOLBOX_ITEM_HEIGHT + 2) + 1) ;
+ Pos = MAP_APPFONT (X0 + 1 , THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT_SW;
@@ -186,7 +196,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_SCRIPT
{
SVLook = TRUE ;
- Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + (TOOLBOX_ITEM_HEIGHT + 2) + 1) ;
+ Pos = MAP_APPFONT (X0 + 1 , THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT;
@@ -209,7 +219,7 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBox TB_SPACING
{
SVLook = TRUE ;
- Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1 + TOOLBOX_ITEM_WIDTH * 2 + 4 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + (TOOLBOX_ITEM_HEIGHT + 2) + 1) ;
+ Pos = MAP_APPFONT (X1, THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_24_16_ITEM_DD_WIDTH, TOOLBOX_24_16_ITEM_HEIGHT ) ;
TabStop = TRUE ;
HelpID = HID_TB_SPACING;
More information about the Libreoffice-commits
mailing list