From ea8d677f93fc7805a53eaa63c0a978d969b3b8b5 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 15 Feb 2009 19:47:48 +0000 Subject: [PATCH] Chameleion GTK improvements (better support of nigh themes) git-svn-id: svn://ultimatepp.org/upp/trunk@868 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/Button.cpp | 4 ++-- uppsrc/CtrlLib/ChGtk.cpp | 3 ++- uppsrc/CtrlLib/MultiButton.cpp | 8 +++++--- uppsrc/CtrlLib/MultiButton.h | 1 + uppsrc/CtrlLib/key_header.h | 1 + uppsrc/CtrlLib/key_source.h | 1 + uppsrc/ide/QuickTabs/QuickTabs.cpp | 2 +- uppsrc/ide/ide.lay | 24 ++++++++++++------------ uppsrc/ide/version.h | 2 +- 9 files changed, 26 insertions(+), 20 deletions(-) diff --git a/uppsrc/CtrlLib/Button.cpp b/uppsrc/CtrlLib/Button.cpp index 6af9e0bf9..5b0c67a4d 100644 --- a/uppsrc/CtrlLib/Button.cpp +++ b/uppsrc/CtrlLib/Button.cpp @@ -182,8 +182,8 @@ CH_STYLE(Button, Style, StyleNormal) { CtrlsImageLook(look, CtrlsImg::I_B); monocolor[0] = monocolor[1] = monocolor[2] = monocolor[3] = - Blend(Blend(SColorHighlight, SColorShadow), SColorText, 80); - textcolor[0] = textcolor[1] = textcolor[2] = SColorText(); + Blend(Blend(SColorHighlight, SColorShadow), SColorLabel, 80); + textcolor[0] = textcolor[1] = textcolor[2] = SColorLabel(); textcolor[3] = SColorDisabled(); font = StdFont(); pressoffset = Point(0, 0); diff --git a/uppsrc/CtrlLib/ChGtk.cpp b/uppsrc/CtrlLib/ChGtk.cpp index 08a0a4c83..ccaf8db71 100644 --- a/uppsrc/CtrlLib/ChGtk.cpp +++ b/uppsrc/CtrlLib/ChGtk.cpp @@ -728,7 +728,7 @@ void ChHostSkin() ChGtkColor(s.textcolor, 0 * 5); s.pressoffset = po; - Color c = SColorPaper(); + Color c = SColorFace(); for(int i = 0; i < 4; i++) s.monocolor[i] = c.GetR() + c.GetG() + c.GetB() < 3 * 128 ? White() : Black(); s.monocolor[3] = Gray(); @@ -1170,6 +1170,7 @@ void ChHostSkin() s.topitemtext[0] = menu_topitemtext_color[0]; s.topitemtext[1] = menu_topitemtext_color[1]; s.topitemtext[2] = menu_topitemtext_color[2]; + SColorMenuText_Write(menu_topitemtext_color[0]); s.topitem[1] = s.topitem[0]; GtkCh(s.topitem[2], sw, GTK_STATE_PRELIGHT); s.topitemtext[2] = ChGtkColor(2, top_item); diff --git a/uppsrc/CtrlLib/MultiButton.cpp b/uppsrc/CtrlLib/MultiButton.cpp index 25fae2806..1001865fa 100644 --- a/uppsrc/CtrlLib/MultiButton.cpp +++ b/uppsrc/CtrlLib/MultiButton.cpp @@ -8,6 +8,7 @@ CH_STYLE(MultiButton, Style, StyleDefault) simple[i] = left[i] = right[i] = lmiddle[i] = rmiddle[i] = Button::StyleEdge().look[i]; monocolor[i] = Button::StyleEdge().monocolor[i]; + fmonocolor[i] = i == 3 ? SColorDisabled() : SColorText(); look[i] = trivial[i] = ChLookWith(simple[i], CtrlsImg::DA(), monocolor[i]); edge[i] = EditFieldEdge(); } @@ -320,10 +321,11 @@ void MultiButton::Paint(Draw& w) ChPaint(w, x, border, cx, sz.cy - 2 * border, style->simple[st]); else if(frm) { - if(IsTrivial() && style->usetrivial) + if(IsTrivial() && style->usetrivial) { dopaint = false; ChPaint(w, x, border, cx, sz.cy - 2 * border, dopaint ? v : style->trivial[st]); + } } else { w.Clip(x, 0, cx, sz.cy); @@ -359,7 +361,7 @@ void MultiButton::Paint(Draw& w) else if(!right) p.x += style->roff; if(b.monoimg || IsNull(b.img)) - w.DrawImage(p.x, p.y, m, style->monocolor[st]); + w.DrawImage(p.x, p.y, m, frm ? style->fmonocolor[st] : style->monocolor[st]); else w.DrawImage(p.x, p.y, m); @@ -372,7 +374,7 @@ void MultiButton::Paint(Draw& w) (b.left ? left : right) = true; } Rect r, cr; - Color text = SColorText(); + Color text = SColorLabel(); Color paper = Null; if(ComplexFrame()) { cr = GetSize(); diff --git a/uppsrc/CtrlLib/MultiButton.h b/uppsrc/CtrlLib/MultiButton.h index 525f66d88..90812aba8 100644 --- a/uppsrc/CtrlLib/MultiButton.h +++ b/uppsrc/CtrlLib/MultiButton.h @@ -30,6 +30,7 @@ public: Value trivial[4]; int trivialborder; Color monocolor[4]; + Color fmonocolor[4]; Point pressoffset; Value sep1, sep2; int sepm; diff --git a/uppsrc/CtrlLib/key_header.h b/uppsrc/CtrlLib/key_header.h index 9ce95cf27..b4638aad2 100644 --- a/uppsrc/CtrlLib/key_header.h +++ b/uppsrc/CtrlLib/key_header.h @@ -28,3 +28,4 @@ namespace KEYNAMESPACE { #undef KEYGROUPNAME #undef KEY #undef KEY2 +#undef KEYFILE diff --git a/uppsrc/CtrlLib/key_source.h b/uppsrc/CtrlLib/key_source.h index 31e4e6878..b01b3574d 100644 --- a/uppsrc/CtrlLib/key_source.h +++ b/uppsrc/CtrlLib/key_source.h @@ -39,3 +39,4 @@ INITBLOCK { #endif #undef KEYGROUPNAME +#undef KEYFILE diff --git a/uppsrc/ide/QuickTabs/QuickTabs.cpp b/uppsrc/ide/QuickTabs/QuickTabs.cpp index 1dfff132d..eb9dce671 100644 --- a/uppsrc/ide/QuickTabs/QuickTabs.cpp +++ b/uppsrc/ide/QuickTabs/QuickTabs.cpp @@ -400,7 +400,7 @@ void QuickTabs::DrawTab(Draw &w, int i) int ty = (h - t.tsz.cy) / 2 + 1; DrawFileName(w, x + QT_MARGIN + (QT_FILEICON + QT_SPACEICON) * int(file_icons), ty, t.tsz.cx, t.tsz.cy, fn.ToWString(), - false, StdFont(), Black, LtBlue, Null, Null, false); + false, StdFont(), SColorLabel(), LtBlue, Null, Null, false); } diff --git a/uppsrc/ide/ide.lay b/uppsrc/ide/ide.lay index d7cba400f..fb9d1890f 100644 --- a/uppsrc/ide/ide.lay +++ b/uppsrc/ide/ide.lay @@ -227,22 +227,22 @@ LAYOUT(LicenseLayout, 700, 536) ITEM(Button, ok, SetLabel(t_("Yes")).RightPosZ(8, 64).BottomPosZ(8, 24)) END_LAYOUT -LAYOUT(OutputModeLayout, 616, 604) +LAYOUT(OutputModeLayout, 616, 480) ITEM(Label, dv___0, SetLabel(t_("&Build method:")).LeftPosZ(10, 70).TopPosZ(4, 19)) ITEM(DropList, method, LeftPosZ(82, 184).TopPosZ(4, 19)) ITEM(Switch, mode, SetLabel(t_("Debug \nOptimal\nOptimize speed\nOptimize size")).LeftPosZ(244, 356).TopPosZ(32, 18)) - ITEM(LabelBox, dv___3, LeftPosZ(304, 4).TopPosZ(28, 484)) - UNTYPED(debug, LeftPosZ(8, 288).TopPosZ(56, 456)) + ITEM(LabelBox, dv___3, LeftPosZ(304, 4).TopPosZ(28, 356)) + UNTYPED(debug, LeftPosZ(8, 288).TopPosZ(56, 332)) ITEM(LabelBox, dv___5, SetLabel(t_("Release")).LeftPosZ(320, 288).TopPosZ(16, 36)) - UNTYPED(release, LeftPosZ(320, 288).TopPosZ(56, 456)) - ITEM(Label, dv___7, SetLabel(t_("To directory")).LeftPosZ(12, 68).TopPosZ(532, 21)) - ITEM(LabelBox, dv___8, SetLabel(t_("Export project")).LeftPosZ(8, 600).TopPosZ(516, 48)) - ITEM(EditString, export_dir, LeftPosZ(80, 316).TopPosZ(533, 19)) - ITEM(Button, export_used, SetLabel(t_("Used")).LeftPosZ(400, 64).TopPosZ(531, 24)) - ITEM(Button, export_all, SetLabel(t_("All")).LeftPosZ(468, 64).TopPosZ(531, 24)) - ITEM(Button, export_makefile, SetLabel(t_("Makefile")).LeftPosZ(536, 64).TopPosZ(531, 24)) - ITEM(Button, ok, SetLabel(t_("OK")).HCenterPosZ(64, 200).TopPosZ(572, 24)) - ITEM(Button, cancel, SetLabel(t_("Cancel")).HCenterPosZ(64, 268).TopPosZ(572, 24)) + UNTYPED(release, LeftPosZ(320, 288).TopPosZ(56, 332)) + ITEM(Label, dv___7, SetLabel(t_("To directory")).LeftPosZ(12, 68).TopPosZ(408, 21)) + ITEM(LabelBox, dv___8, SetLabel(t_("Export project")).LeftPosZ(8, 600).TopPosZ(392, 48)) + ITEM(EditString, export_dir, LeftPosZ(80, 316).TopPosZ(409, 19)) + ITEM(Button, export_used, SetLabel(t_("Used")).LeftPosZ(400, 64).TopPosZ(407, 24)) + ITEM(Button, export_all, SetLabel(t_("All")).LeftPosZ(468, 64).TopPosZ(407, 24)) + ITEM(Button, export_makefile, SetLabel(t_("Makefile")).LeftPosZ(536, 64).TopPosZ(407, 24)) + ITEM(Button, ok, SetLabel(t_("OK")).HCenterPosZ(64, 200).TopPosZ(448, 24)) + ITEM(Button, cancel, SetLabel(t_("Cancel")).HCenterPosZ(64, 268).TopPosZ(448, 24)) END_LAYOUT LAYOUT(InstallLayout, 312, 112) diff --git a/uppsrc/ide/version.h b/uppsrc/ide/version.h index c46c71ab6..2365c3ec9 100644 --- a/uppsrc/ide/version.h +++ b/uppsrc/ide/version.h @@ -1 +1 @@ -#define IDE_VERSION "901r180" +#define IDE_VERSION "902r181"