mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
.cosmetics
This commit is contained in:
parent
0b44641396
commit
6a0e4b57b5
3 changed files with 2 additions and 2 deletions
|
|
@ -1,9 +0,0 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct MyApp : TopWindow {
|
||||
void Paint(Draw& w) override {
|
||||
Size sz = GetSize();
|
||||
// w.DrawRect(sz, WhiteGray()); return;
|
||||
|
||||
auto h = GetCustomTitleBarMetrics().height;
|
||||
Color c2 = SLtCyan();
|
||||
for(int i = 0; i < h; i++)
|
||||
w.DrawRect(0, i, sz.cx, 1, Blend(WhiteGray(), c2, i * 255 / h));
|
||||
}
|
||||
|
||||
void Layout() override {
|
||||
auto m = GetCustomTitleBarMetrics();
|
||||
int h = bar.GetHeight();
|
||||
bar.LeftPos(m.lm, bar.GetWidth()).TopPos((m.height - h) / 2, h);
|
||||
}
|
||||
|
||||
void MainMenu(Bar& bar)
|
||||
{
|
||||
bar.Sub("File", [=](Bar& bar) {
|
||||
bar.Add("Exit", [=] { Break(); });
|
||||
});
|
||||
}
|
||||
|
||||
MenuBar bar;
|
||||
LineEdit editor;
|
||||
|
||||
MyApp() {
|
||||
Icon(CtrlImg::select_all());
|
||||
|
||||
CustomTitleBar(200);
|
||||
|
||||
Add(bar);
|
||||
bar.Transparent();
|
||||
bar.Set([=](Bar& bar) {
|
||||
MainMenu(bar);
|
||||
});
|
||||
|
||||
DDUMP(bar.GetWidth());
|
||||
DDUMP(bar.GetHeight());
|
||||
|
||||
DDUMP(GetCustomTitleBarMetrics().height);
|
||||
|
||||
Add(editor.VSizePos(GetCustomTitleBarMetrics().height).HSizePos());
|
||||
};
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Sizeable().Zoomable().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue