Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

fix: use secondary buttons in dialogs

Petar Margetić9ae0db7e6950
diff --git a/src/files/app_paint.zig b/src/files/app_paint.zig
index fed34cd..2958040 100644
--- a/src/files/app_paint.zig
+++ b/src/files/app_paint.zig
@@ -296,7 +296,7 @@ pub fn renderRenameCard(self: *App, cr: *c.cairo_t, card: RenameCard) void {
for ([_]header.Rect{ card.confirm, card.cancel }, 0..) |rect, i| {
var layer = shell_ui.Layer.begin(cr, .{ .x = @floatCast(rect.x), .y = @floatCast(rect.y), .w = @floatCast(rect.w), .h = @floatCast(rect.h) }) orelse continue;
ui_button.paint(&layer.renderer, layer.local(), .{
- .variant = .ghost,
+ .variant = .secondary,
.icon = if (i == 0) .checkmark else .close,
.icon_scale = 0.55,
.label = if (i == 0) tr("Rename") else tr("Cancel"),
diff --git a/src/files/open_with.zig b/src/files/open_with.zig
index 45f0d3e..1fb3f46 100644
--- a/src/files/open_with.zig
+++ b/src/files/open_with.zig
@@ -298,7 +298,7 @@ pub const State = struct {
scrollbar.paint(r, scrollbar.look(bar, .{}, theme.global.scrollbar_width, palette));
if (self.shortcut_catalog == null) {
r.fillRect(16, g.divider, g.box.w - 32, 1, .{ .color = theme.global.app_divider });
- button.paint(r, g.more, .{ .size = .sm, .variant = .ghost, .alignment = .left, .leading_icon = .plus, .label = if (self.all) tr("Back to recommended apps") else tr("Choose another app…") }, .{ .focused = self.focus == .more, .pointer = if (hovered == 4) .hover else .idle });
+ button.paint(r, g.more, .{ .size = .sm, .variant = .secondary, .alignment = .left, .leading_icon = .plus, .label = if (self.all) tr("Back to recommended apps") else tr("Choose another app…") }, .{ .focused = self.focus == .more, .pointer = if (hovered == 4) .hover else .idle });
const extension = std.fs.path.extension(self.apps.paths[0]);
const remember_label = if (extension.len > 0 and self.apps.paths.len == 1)
i18n.fmt(&buffer, tr("Always use this app for {value} files"), .{ .value = extension }) catch tr("Always use this app for this file type")
diff --git a/src/files/properties.zig b/src/files/properties.zig
index a3901b8..d707cf2 100644
--- a/src/files/properties.zig
+++ b/src/files/properties.zig
@@ -217,7 +217,7 @@ pub const State = struct {
var accent_palette = palette;
accent_palette.fg = palette.accent;
r.palette = accent_palette;
- button.paint(r, g.open, .{ .icon = .open, .variant = .ghost, .label = tr("Open") }, .{ .focused = self.keyboard_focus and self.focus == 1, .pointer = if (hover == 2) .hover else .idle });
+ button.paint(r, g.open, .{ .icon = .open, .variant = .secondary, .label = tr("Open") }, .{ .focused = self.keyboard_focus and self.focus == 1, .pointer = if (hover == 2) .hover else .idle });
r.palette = palette;
r.fillRect(24, 146 - s, g.box.w - 48, 1, .{ .color = theme.global.app_divider });
var size_buf: [128]u8 = undefined;
diff --git a/src/pdf/app_paint.zig b/src/pdf/app_paint.zig
index ae6b0c4..0204576 100644
--- a/src/pdf/app_paint.zig
+++ b/src/pdf/app_paint.zig
@@ -545,7 +545,7 @@ pub fn renderButtonText(self: *App, cr: *c.api.cairo_t, x: f64, y: f64, w: f64,
var layer = shell_ui.Layer.begin(cr, .{ .x = @floatCast(x), .y = @floatCast(y), .w = @floatCast(w), .h = @floatCast(h) }) orelse return;
defer layer.finish();
ui_button.paint(&layer.renderer, layer.local(), .{
- .variant = .ghost,
+ .variant = .secondary,
.label = label,
}, .{ .pointer = if (is_hover) .hover else .idle });
}