Skip to content

Commit e171f40

Browse files
committed
tweaked button and tab control layout
1 parent e8fee70 commit e171f40

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

visuald/propertypage.d

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import stdext.path;
3131
import std.array;
3232
import std.string;
3333
import std.conv;
34+
import std.algorithm;
3435

3536
// version = DParserOption;
3637

@@ -446,17 +447,21 @@ abstract class PropertyPage : DisposingComObject, IPropertyPage, IVsPropertyPage
446447
{
447448
x -= mUnindentCheckBox;
448449
}
450+
449451
int h = lines * kLineHeight - kLineSpacing;
450452
if(cast(Text) w && lines == 1)
451453
{
452454
h = kTextHeight;
453455
}
454456
else if(cb)
455457
h -= 2;
458+
else if(tc)
459+
h += tc.getFrameHeight() - kLineHeight;
456460
//else if(cast(ComboBox) w)
457461
// h -= 4;
458462

459-
int y = mLineY + (lines * kLineHeight - kLineSpacing - h) / 2;
463+
int yspacing = (lines * kLineHeight - kLineSpacing - h) / 2;
464+
int y = mLineY + max(0, yspacing);
460465
if(w)
461466
{
462467
w.setRect(x, y, pageWidth - 2*margin - labelWidth, h);
@@ -468,13 +473,13 @@ abstract class PropertyPage : DisposingComObject, IPropertyPage, IVsPropertyPage
468473
}
469474
if(btn)
470475
{
471-
btn.setRect(pageWidth, y, kLineHeight, kLineHeight - kLineSpacing);
476+
btn.setRect(pageWidth - kMargin, y, kLineHeight, kLineHeight - kLineSpacing);
472477
Attachment att = kAttachRight;
473478
att.vdiv = 1000;
474479
att.top = att.bottom = mAttachY;
475480
addResizableWidget(btn, att);
476481
}
477-
mLineY += lines * kLineHeight;
482+
mLineY += max(h, lines * kLineHeight);
478483
mAttachY += resizeY;
479484
}
480485

@@ -483,7 +488,10 @@ abstract class PropertyPage : DisposingComObject, IPropertyPage, IVsPropertyPage
483488
auto w = new Label(mCanvas);
484489
w.AddWindowStyle(SS_ETCHEDFRAME, SS_TYPEMASK);
485490
w.setRect(0, mLineY + 2, getWidgetWidth(mCanvas, kPageWidth) - 2*kMargin, 2);
486-
addResizableWidget(w, kAttachLeftRight);
491+
Attachment att = kAttachLeftRight;
492+
att.vdiv = 1000;
493+
att.top = att.bottom = mAttachY;
494+
addResizableWidget(w, att);
487495
mLineY += 6;
488496
}
489497

@@ -1819,6 +1827,7 @@ class DirPropertyPage : GlobalPropertyPage
18191827
mLinesPerMultiLine = 2;
18201828
btn = new Button(mCanvas, "+", ID_IMPORTDIR);
18211829
AddControl("Import paths", mImpPath = new MultiLineText(mCanvas), btn, 300);
1830+
18221831
mLinesPerMultiLine = 10;
18231832
string[] archs = ["Win32", "x64"];
18241833
if(overrideIni.length)
@@ -2151,7 +2160,7 @@ class ColorizerPropertyPage : GlobalPropertyPage
21512160
override void CreateControls()
21522161
{
21532162
AddControl("", mColorizeVersions = new CheckBox(mCanvas, "Colorize version and debug statements"));
2154-
AddControl("Colored types", mUserTypes = new MultiLineText(mCanvas));
2163+
AddControl("Colored types", mUserTypes = new MultiLineText(mCanvas), 1000);
21552164
AddHorizontalLine();
21562165
AddControl("", mColorizeCoverage = new CheckBox(mCanvas, "Colorize coverage from .LST file"));
21572166
AddControl("", mShowCoverageMargin = new CheckBox(mCanvas, "Show coverage margin"));

visuald/register.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ version(none){
582582

583583
// menu
584584
scope RegKey keyToolMenu = new RegKey(keyRoot, registrationRoot ~ "\\Menus"w);
585-
keyToolMenu.Set(packageGuid, ",2001,19"); // CTMENU,version
585+
keyToolMenu.Set(packageGuid, ",2001,20"); // CTMENU,version
586586

587587
// Visual D settings
588588
scope RegKey keyToolOpts = new RegKey(keyRoot, registrationRoot ~ regPathToolsOptions);

visuald/winctrl.d

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class Window : Widget
310310

311311
WNDCLASSA wc;
312312
wc.lpszClassName = "VisualDWindow";
313-
wc.style = CS_OWNDC; // | CS_HREDRAW | CS_VREDRAW;
313+
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
314314
wc.lpfnWndProc = &WinWindowProc;
315315
wc.hInstance = hInst;
316316
wc.hIcon = null; //DefaultWindowIcon.peer;
@@ -844,6 +844,18 @@ class TabControl : Widget
844844
return true;
845845
}
846846

847+
// space for header and footer
848+
int getFrameHeight()
849+
{
850+
RECT r;
851+
r.left = 0;
852+
r.right = 100;
853+
r.top = 0;
854+
r.bottom = 100;
855+
SendMessage(TCM_ADJUSTRECT, false, cast(LPARAM)&r);
856+
return r.top + (100 - r.bottom);
857+
}
858+
847859
int getCurSel()
848860
{
849861
return SendMessage(TCM_GETCURSEL, 0, 0);

0 commit comments

Comments
 (0)