mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib: Gtk3 ch improved focus look
git-svn-id: svn://ultimatepp.org/upp/trunk@13940 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
63cb1bd86f
commit
7f913eefe8
5 changed files with 9 additions and 2 deletions
|
|
@ -76,3 +76,5 @@ DONE:
|
|||
- WithDropChoice ch issue (again...)
|
||||
- Problem with multibutton is back again
|
||||
- Redmond scrollbars width
|
||||
- Improve focus visuals
|
||||
|
||||
|
|
|
|||
|
|
@ -458,6 +458,7 @@ void ChStdSkin()
|
|||
for(int pass = 0; pass < 2; pass++) {
|
||||
Button::Style& s = pass ? Button::StyleOk().Write() : Button::StyleNormal().Write();
|
||||
int roundness = DPI(3);
|
||||
s.focusmargin = DPI(4);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
static int adj[] = { 10, 80, -5, -10 };
|
||||
Color f = Adjust(SColorFace(), adj[i]);
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ void ChHostSkin()
|
|||
Image button[4];
|
||||
for(int pass = 0; pass < 2; pass++) {
|
||||
Button::Style& s = pass ? Button::StyleOk().Write() : Button::StyleNormal().Write();
|
||||
s.focusmargin = DPI(4);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
Gtk_State(i);
|
||||
s.look[i] = Hot3(CairoImage());
|
||||
|
|
|
|||
|
|
@ -395,11 +395,11 @@ void DrawFocus(Draw& w, int x, int y, int cx, int cy, Color c) {
|
|||
w.Clipoff(x, y, cx, cy);
|
||||
for(int a = 0; a < cx; a += CtrlImg::focus_h().GetWidth()) {
|
||||
w.DrawImage(a, 0, CtrlImg::focus_h(), c);
|
||||
w.DrawImage(a, cy - 1, CtrlImg::focus_h(), c);
|
||||
w.DrawImage(a, cy - DPI(1), CtrlImg::focus_h(), c);
|
||||
}
|
||||
for(int a = 0; a < cy; a += CtrlImg::focus_v().GetHeight()) {
|
||||
w.DrawImage(0, a, CtrlImg::focus_v(), c);
|
||||
w.DrawImage(cx - 1, a, CtrlImg::focus_v(), c);
|
||||
w.DrawImage(cx - DPI(1), a, CtrlImg::focus_v(), c);
|
||||
}
|
||||
w.End();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -373,6 +373,7 @@ Rect MultiButton::Paint0(Draw& w, bool getcr)
|
|||
if(HasFocus()) {
|
||||
fpaper = SColorHighlight();
|
||||
text = SColorHighlightText();
|
||||
hotpressed = true;
|
||||
}
|
||||
else
|
||||
fpaper = IsEnabled() && IsEditable() ? SColorPaper() : SColorFace();
|
||||
|
|
@ -386,6 +387,8 @@ Rect MultiButton::Paint0(Draw& w, bool getcr)
|
|||
}
|
||||
ChPaint(w, sz, style->edge[style->activeedge ? mst : 0]);
|
||||
Color p = paper;
|
||||
if(frm && style->activeedge && HasFocus())
|
||||
p = SColorHighlight();
|
||||
if(hotpressed && (WhenPush || WhenClick))
|
||||
p = Nvl(fpaper, paper);
|
||||
if(!IsNull(p) && !IsNull(style->coloredge))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue