CtrlCore: Dark mode is now enabled by default, CtrlLib: classic skin improvements

git-svn-id: svn://ultimatepp.org/upp/trunk@14020 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-02-16 19:32:59 +00:00
parent 3bca4dcd37
commit 58017171ce
5 changed files with 35 additions and 9 deletions

View file

@ -851,7 +851,7 @@ bool Ctrl::IsUHDEnabled()
return ApplicationUHDEnabled;
}
bool ApplicationDarkThemeEnabled;
bool ApplicationDarkThemeEnabled = true;
void Ctrl::SetDarkThemeEnabled(bool set)
{

View file

@ -1,9 +1,7 @@
- TestChStyle problem with EditDate drop (needs one more click)
- Vertical centering of DropList text is a bit off
- Classic is broken
- Inactive doc icon is not updated - [B] does not blink anymore
- Make allocator work
- ClassicCtrlsImg
- FileChooser
- Win32 - always use dark mode, always use UHD
@ -17,6 +15,11 @@ DONE:
- Some problem when switching skin should be solved
- Win32 menu checkbox
- Classic is broken
- ClassicCtrlsImg
macos done:
- Slider in dark mode is transparent
- spin buttons slight visual problem in dark mode
- <-|-> cursor looks bad in dark mode
@ -25,7 +28,6 @@ DONE:
- Remove menu slide effect
- U++ menu has some issues
gtk3 DONE:
- Resizing delay

View file

@ -2601,7 +2601,8 @@ ize]_[*@3 sz])&]
[s5;:Upp`:`:Ctrl`:`:SetUHDEnabled`(bool`):%- [@(0.0.255) void]_[* SetUHDEnabled]([@(0.0.255) b
ool]_[*@3 set])&]
[s2; Informs host platform that application is UHD ready. Default
is true.&]
is true. Disabling UHD mode has to be done before GUI`_APP`_MAIN,
e.g. in INITBLOCK.&]
[s3; &]
[s4;%- &]
[s5;:Upp`:`:Ctrl`:`:IsUHDEnabled`(`):%- [@(0.0.255) bool]_[* IsUHDEnabled]()&]
@ -2614,7 +2615,8 @@ is true.&]
[s2; Hints coloring and skinning algorithms that the application
is ready to work in dark theme mode. Currently this enables dark
theme in Windows (with other platforms dark theme is enabled
by default).&]
by default). Default value is true. Disabling dark theme has
to be done before GUI`_APP`_MAIN, e.g. in INITBLOCK.&]
[s3; &]
[s4;%- &]
[s5;:Upp`:`:Ctrl`:`:IsDarkThemeEnabled`(`):%- [@(0.0.255) static] [@(0.0.255) bool]_[* IsDa

View file

@ -133,8 +133,29 @@ void ChClassicSkin()
}
int c = DPI(14);
for(int i = 0; i < 4; i++) {
SyntheticTab(i, 0, Gray());
{
TabCtrl::Style& s = TabCtrl::StyleDefault().Write();
s.body = MakeClassicButton(White(), Black(), wg, Gray(), SColorFace());
Color f = i == CTRL_PRESSED ? SColorFace : grayface;
Image t = MakeClassicButton(White(), Black(), wg, Gray(), f);
Size isz = t.GetSize();
isz.cy -= 2;
ImageDraw iw(isz);
iw.DrawImage(0, 0, t);
if(i == CTRL_PRESSED) { // the active tab
iw.DrawRect(isz.cx - 1, isz.cy - 2, 2, 1, White());
iw.DrawRect(isz.cx - 2, isz.cy - 1, 2, 1, wg);
}
t = iw;
SetHotSpots(t, Point(2, 2));
s.first[i] = s.last[i] = s.both[i] = s.normal[i] = t;
s.margin = 0;
s.sel = Rect(0, DPI(1), 0, DPI(1));
s.extendleft = DPI(2);
s.text_color[i] = SColorText();
}
static int adj[] = { 10, 80, -5, -10 };
Color f = FaceColor(adj[i]);
{

View file

@ -1,4 +1,5 @@
#include "CtrlLib.h"
#include "CtrlLib.h"
namespace Upp {
@ -579,9 +580,9 @@ TabCtrl::TabCtrl()
Ctrl::Add(tabs);
Ctrl::Add(pane);
tabs.BackPaint().IgnoreMouse();
Ctrl::Add(left.SetImage(CtrlsImg::SLA()).ScrollStyle().NoWantFocus());
Ctrl::Add(left.SetMonoImage(CtrlsImg::SLA()).ScrollStyle().NoWantFocus());
left <<= THISBACK(Left);
Ctrl::Add(right.SetImage(CtrlsImg::SRA()).ScrollStyle().NoWantFocus());
Ctrl::Add(right.SetMonoImage(CtrlsImg::SRA()).ScrollStyle().NoWantFocus());
right <<= THISBACK(Right);
Transparent().NoWantFocus();
tabs.Transparent().NoWantFocus();