diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-29 22:14:15 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-29 22:14:15 +0200 |
commit | e0feeab5eb91b556c529d97da89b915ab821e285 (patch) | |
tree | 1397a7454321708e05c1de807ce7e28bb144a755 /src/ui/labelwidget.c | |
parent | 31a6a229bd5fdc81f6b9a14a8b5e0daf219e2418 (diff) |
Fixed drawing of widget frames
In CertImportWidget at regular-DPI 1.0 scaling, the frames of the certificate and private key labels were drawn incorrectly.
Now the non-button LabelWidget relies on Widget to draw the frames.
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r-- | src/ui/labelwidget.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index bd8b71da..57136509 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -128,7 +128,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int | |||
128 | /* Default color state. */ | 128 | /* Default color state. */ |
129 | *bg = isButton ? uiBackground_ColorId : none_ColorId; | 129 | *bg = isButton ? uiBackground_ColorId : none_ColorId; |
130 | *fg = uiText_ColorId; | 130 | *fg = uiText_ColorId; |
131 | *frame1 = isButton ? uiEmboss1_ColorId : uiFrame_ColorId; | 131 | *frame1 = isButton ? uiEmboss1_ColorId : d->widget.frameColor; |
132 | *frame2 = isButton ? uiEmboss2_ColorId : *frame1; | 132 | *frame2 = isButton ? uiEmboss2_ColorId : *frame1; |
133 | if (flags_Widget(w) & disabled_WidgetFlag && isButton) { | 133 | if (flags_Widget(w) & disabled_WidgetFlag && isButton) { |
134 | *fg = uiTextDisabled_ColorId; | 134 | *fg = uiTextDisabled_ColorId; |
@@ -207,9 +207,6 @@ static void draw_LabelWidget_(const iLabelWidget *d) { | |||
207 | drawLines_Paint(&p, points + 2, 3, frame2); | 207 | drawLines_Paint(&p, points + 2, 3, frame2); |
208 | drawLines_Paint(&p, points, 3, frame); | 208 | drawLines_Paint(&p, points, 3, frame); |
209 | } | 209 | } |
210 | else { | ||
211 | drawRect_Paint(&p, frameRect, frame); | ||
212 | } | ||
213 | } | 210 | } |
214 | setClip_Paint(&p, rect); | 211 | setClip_Paint(&p, rect); |
215 | if (flags & wrapText_WidgetFlag) { | 212 | if (flags & wrapText_WidgetFlag) { |
@@ -285,6 +282,7 @@ void init_LabelWidget(iLabelWidget *d, const char *label, const char *cmd) { | |||
285 | initCStr_String(&d->command, cmd); | 282 | initCStr_String(&d->command, cmd); |
286 | } | 283 | } |
287 | else { | 284 | else { |
285 | setFrameColor_Widget(&d->widget, uiFrame_ColorId); | ||
288 | init_String(&d->command); | 286 | init_String(&d->command); |
289 | } | 287 | } |
290 | d->key = 0; | 288 | d->key = 0; |