summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-07-08 20:26:38 +0200
committerAndras Timar <atimar@suse.com>2012-07-08 20:26:38 +0200
commit1259cee4111a6b8f66d8583166c2ff9f3fc4d80d (patch)
tree6930c4cbac78a2998cbfa5ff6f9961e6847c75b1
parent266a6ab3652a4c2f70f6598e56c8bdd63f1cf171 (diff)
fix a few layout problems in Conditional Formatting dialog
Absolute pixel coordinates should not be used, because we work with font size dependent relative coordinates all over the place. Layout on Linux was OK, but controls were positioned partially outside the visible area on Windows. Change-Id: Iee417f57135ada7ea9cb73726c56f96b3154e0b8
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx19
-rw-r--r--sc/source/ui/src/condformatdlg.src10
2 files changed, 16 insertions, 13 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 79a111d6db5e..9ba146d1e5ef 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -320,12 +320,12 @@ void ScCondFrmtEntry::Init()
Point aPointCol = maLbColMiddle.GetPosPixel();
Point aPointEdDataBar = maEdDataBarMin.GetPosPixel();
Point aPointLbDataBar = maLbDataBarMaxType.GetPosPixel();
- const long nMovePos = 250;
+ const long nMovePos = maLbEntryTypeMiddle.GetSizePixel().Width() * 1.2;
aPointLb.X() += nMovePos;
aPointEd.X() += nMovePos;
aPointCol.X() += nMovePos;
- aPointEdDataBar.X() += 1.5*nMovePos;
- aPointLbDataBar.X() += 1.5*nMovePos;
+ aPointEdDataBar.X() += 2*nMovePos;
+ aPointLbDataBar.X() += 2*nMovePos;
maLbEntryTypeMiddle.SetPosPixel(aPointLb);
maEdMiddle.SetPosPixel(aPointEd);
maLbColMiddle.SetPosPixel(aPointCol);
@@ -444,6 +444,10 @@ void ScCondFrmtEntry::HideCondElements()
void ScCondFrmtEntry::SetCondType()
{
+ maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
+ Point aPoint(maLbCondType.GetPosPixel().X() + maLbCondType.GetSizePixel().Width() + LogicToPixel(Size(5,1), MapMode(MAP_APPFONT)).getWidth(),
+ maEdVal1.GetPosPixel().Y());
+ maEdVal1.SetPosPixel(aPoint);
maEdVal1.Show();
maEdVal2.Show();
maLbStyle.Show();
@@ -562,6 +566,10 @@ void ScCondFrmtEntry::SetFormulaType()
SwitchToType(FORMULA);
HideColorScaleElements();
HideDataBarElements();
+ maEdVal1.SetPosPixel(maLbCondType.GetPosPixel());
+ Size aSize(maEdVal2.GetPosPixel().X() + maEdVal2.GetSizePixel().Width() - maLbCondType.GetPosPixel().X(), maEdVal1.GetSizePixel().Height());
+ maEdVal1.SetPosPixel(maLbCondType.GetPosPixel());
+ maEdVal1.SetSizePixel(aSize);
maEdVal1.Show();
maEdVal2.Hide();
maLbCondType.Hide();
@@ -569,8 +577,6 @@ void ScCondFrmtEntry::SetFormulaType()
maFtCondition.Show();
maWdPreview.Show();
maFtStyle.Show();
- Size aSize(440, 30);
- maEdVal1.SetSizePixel(aSize);
}
void ScCondFrmtEntry::Select()
@@ -894,14 +900,11 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
{
if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7)
{
- maEdVal1.SetSizePixel(maEdVal2.GetSizePixel());
maEdVal2.Show();
}
else
{
maEdVal2.Hide();
- Size aSize(440, 30);
- maEdVal1.SetSizePixel(aSize);
}
return 0;
}
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index ebf84f397144..174da1fdc4cc 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -108,7 +108,7 @@ Control RID_COND_ENTRY
ListBox LB_CELLIS_TYPE
{
Pos = MAP_APPFONT( 70, 15 );
- Size = MAP_APPFONT( 50, 40 );
+ Size = MAP_APPFONT( 80, 40 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
@@ -133,14 +133,14 @@ Control RID_COND_ENTRY
};
Edit ED_VAL1
{
- Pos = MAP_APPFONT( 125, 15 );
- Size = MAP_APPFONT( 160, 12 );
+ Pos = MAP_APPFONT( 155, 15 );
+ Size = MAP_APPFONT( 50, 12 );
Border = TRUE;
};
Edit ED_VAL2
{
Pos = MAP_APPFONT( 210, 15 );
- Size = MAP_APPFONT( 75, 12 );
+ Size = MAP_APPFONT( 50, 12 );
Border = TRUE;
};
ListBox LB_STYLE
@@ -157,7 +157,7 @@ Control RID_COND_ENTRY
ListBox LB_COLOR_FORMAT
{
Pos = MAP_APPFONT( 70, 15 );
- Size = MAP_APPFONT( 60, 60);
+ Size = MAP_APPFONT( 80, 60);
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =