mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-10 03:54:54 -06:00
CtrlLib: single line switch now vertically centered
git-svn-id: svn://ultimatepp.org/upp/trunk@7445 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
02a69c191e
commit
ca3e3e1c15
4 changed files with 15 additions and 9 deletions
|
|
@ -415,13 +415,17 @@ ctrl Switch {
|
|||
setlabel = .SetLabel;
|
||||
for(i = 0; i < count(cs); i++) {
|
||||
textsize = GetSmartTextSize(cs[i], .SetFont);
|
||||
w.DrawImage(x, y, "ClassicCtrlsImg::S0");
|
||||
w.DrawSmartText(x + imagesize.cx + 4, y + (imagesize.cy - tcy) / 2,
|
||||
cs[i], .SetFont);
|
||||
if(linecy * count(cs) > sz.cy)
|
||||
if(linecy * count(cs) > sz.cy) {
|
||||
w.DrawImage(x, (sz.cy - imagesize.cy) / 2, "ClassicCtrlsImg::S0");
|
||||
w.DrawSmartText(x + imagesize.cx + 4, (sz.cy - tcy) / 2, cs[i], .SetFont);
|
||||
x += imagesize.cx + 4 + textsize.cx + max(imagesize.cy, tcy) / 2;
|
||||
else
|
||||
}
|
||||
else {
|
||||
w.DrawImage(x, y, "ClassicCtrlsImg::S0");
|
||||
w.DrawSmartText(x + imagesize.cx + 4, y + (imagesize.cy - tcy) / 2,
|
||||
cs[i], .SetFont);
|
||||
y += linecy;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -158,12 +158,14 @@ void Switch::Paint(Draw& w) {
|
|||
linecy = max(mincy, max(16, tcy + 2));
|
||||
int y = 0;
|
||||
int x = 0;
|
||||
int ty = (linecy - tcy) / 2;
|
||||
bool horz = linecy * cs.GetCount() > sz.cy;
|
||||
if(horz)
|
||||
if(horz) {
|
||||
posx.SetCount(cs.GetCount());
|
||||
linecy = sz.cy;
|
||||
}
|
||||
else
|
||||
posx.Clear();
|
||||
int ty = (linecy - tcy) / 2;
|
||||
bool ds = !IsShowEnabled();
|
||||
int i;
|
||||
light = -1;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define _CtrlLib_icpp_init_stub
|
||||
#include "CtrlCore/init"
|
||||
#include "PdfDraw/init"
|
||||
#define BLITZ_INDEX__ Fa588a2a7bb40a3ed36760f6c2bef5026
|
||||
#define BLITZ_INDEX__ F2a95805f3896075b0a556396aabaf515
|
||||
#include "CtrlLib.icpp"
|
||||
#undef BLITZ_INDEX__
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ LAYOUT(SetupIdeLayout, 512, 264)
|
|||
ITEM(Label, dv___16, SetLabel(t_("HYDRA threads")).LeftPosZ(212, 80).TopPosZ(4, 19))
|
||||
ITEM(EditIntSpin, hydra1_threads, Max(64).Min(1).LeftPosZ(344, 48).TopPosZ(4, 19))
|
||||
ITEM(Option, output_per_assembly, SetLabel(t_("Use unique output directory per assembly (append assembly name to output directory)")).HSizePosZ(4, 4).TopPosZ(224, 16))
|
||||
ITEM(Switch, gdbSelector, SetLabel(t_("Legacy\nGDB_MI2 (new)")).LeftPosZ(344, 176).TopPosZ(32, 24))
|
||||
ITEM(Switch, gdbSelector, SetLabel(t_("Legacy\nGDB_MI2 (new)")).LeftPosZ(344, 176).TopPosZ(28, 20))
|
||||
ITEM(Label, dv___20, SetLabel(t_("GDB Debugger interface")).LeftPosZ(212, 188).TopPosZ(28, 20))
|
||||
END_LAYOUT
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue