separate colour configuration for all button borders and texts

This commit is contained in:
Leon Henrik Plickat 2024-01-05 02:41:28 +01:00
parent c27253841e
commit 49125b9c01
3 changed files with 61 additions and 9 deletions

View file

@ -123,15 +123,14 @@ Defaults to 0xFFFFFF.
.P
\fBborder\fR = \fI<colour>\fR;
.RS
Border colour of the dialog prompt window and the buttons.
Border colour of the dialog prompt window.
Defaults to 0x000000.
.RE
.
.P
\fBtext\fR = \fI<colour>\fR;
.RS
Colour if the title, description and prompt texts as well as of the button
labels.
Colour of the title, description and prompt texts.
Defaults to 0x000000.
.RE
.
@ -171,6 +170,20 @@ Defaults to 0xD5F200.
.RE
.
.P
\fBok\-button\-border\fR = \fI<colour>\fR;
.RS
Border colour of the ok button.
Defaults to 0x000000.
.RE
.
.P
\fBok\-button\-text\fR = \fI<colour>\fR;
.RS
Text colour of the ok button.
Defaults to 0x000000.
.RE
.
.P
\fBnot\-ok\-button\fR = \fI<colour>\fR;
.RS
Background colour of the not ok button.
@ -178,12 +191,40 @@ Defaults to 0xFFE53E.
.RE
.
.P
\fBnot\-ok\-button\-border\fR = \fI<colour>\fR;
.RS
Border colour of the not ok button.
Defaults to 0x000000.
.RE
.
.P
\fBnot\-ok\-button\-text\fR = \fI<colour>\fR;
.RS
Text colour of the not ok button.
Defaults to 0x000000.
.RE
.
.P
\fBcancel\-button\fR = \fI<colour>\fR;
.RS
Background colour of the cancel button.
Defaults to 0xFF4647.
.RE
.
.P
\fBcancel\-button\-border\fR = \fI<colour>\fR;
.RS
Border colour of thcancel ok button.
Defaults to 0x000000.
.RE
.
.P
\fBcancel\-button\-text\fR = \fI<colour>\fR;
.RS
Text colour of the cancel button.
Defaults to 0x000000.
.RE
.
.
.SH AUTHOR
.P

View file

@ -32,14 +32,25 @@ const Labels = struct {
const WaylandColours = struct {
background: pixman.Color = comptimePixmanColourFromRGB("0xffffff"),
border: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
text: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
error_text: pixman.Color = comptimePixmanColourFromRGB("0xe0002b"),
pin_background: pixman.Color = comptimePixmanColourFromRGB("0xd0d0d0"),
pin_border: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
pin_square: pixman.Color = comptimePixmanColourFromRGB("0x808080"),
ok_button: pixman.Color = comptimePixmanColourFromRGB("0xd5f200"),
ok_button_border: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
ok_button_text: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
not_ok_button: pixman.Color = comptimePixmanColourFromRGB("0xffe53e"),
not_ok_button_border: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
not_ok_button_text: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
cancel_button: pixman.Color = comptimePixmanColourFromRGB("0xff4647"),
cancel_button_border: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
cancel_button_text: pixman.Color = comptimePixmanColourFromRGB("0x000000"),
fn assign(self: *WaylandColours, path: []const u8, line: usize, variable: []const u8, value: []const u8) error{BadConfig}!bool {
const info = @typeInfo(WaylandColours).Struct;

View file

@ -824,11 +824,11 @@ const Surface = struct {
uiconf.button_border,
self.scale,
&colours.cancel_button,
&colours.border,
&colours.cancel_button_border,
);
_ = try cancel.draw(
image,
&colours.text,
&colours.cancel_button_text,
X + uiconf.button_inner_padding,
Y + uiconf.button_inner_padding,
uiconf.vertical_padding,
@ -855,11 +855,11 @@ const Surface = struct {
uiconf.button_border,
self.scale,
&colours.not_ok_button,
&colours.border,
&colours.not_ok_button_border,
);
_ = try notok.draw(
image,
&colours.text,
&colours.not_ok_button_text,
X + uiconf.button_inner_padding,
Y + uiconf.button_inner_padding,
uiconf.vertical_padding,
@ -886,11 +886,11 @@ const Surface = struct {
uiconf.button_border,
self.scale,
&colours.ok_button,
&colours.border,
&colours.ok_button_border,
);
_ = try ok.draw(
image,
&colours.text,
&colours.ok_button_text,
X + uiconf.button_inner_padding,
Y + uiconf.button_inner_padding,
uiconf.vertical_padding,