gtk: new approach to reveal/hide buttons

This commit is contained in:
Maciej Bartczak
2025-03-03 19:28:34 +01:00
parent 7123d4e055
commit f71b294697
3 changed files with 105 additions and 66 deletions

View File

@ -14,28 +14,7 @@ Adw.AlertDialog clipboard_confirmation_window {
default-response: "cancel";
close-response: "cancel";
extra-child: Box {
orientation: vertical;
spacing: 12;
Button reveal_button {
visible: false;
styles [
"destructive-action"
]
Adw.ButtonContent {
label: _("Reveal Potentially Sensitive Content");
icon-name: "dialog-warning-symbolic";
}
}
Button hide_button {
visible: false;
label: _("Hide Potentially Sensitive Content");
}
extra-child: Overlay {
ScrolledWindow text_view_scroll {
width-request: 500;
height-request: 250;
@ -54,5 +33,39 @@ Adw.AlertDialog clipboard_confirmation_window {
]
}
}
[overlay]
Button reveal_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"destructive-action",
]
Image {
icon-name: "view-reveal-symbolic";
}
}
[overlay]
Button hide_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"suggested-action",
]
Image {
icon-name: "view-conceal-symbolic";
}
}
};
}

View File

@ -14,28 +14,7 @@ Adw.AlertDialog clipboard_confirmation_window {
default-response: "cancel";
close-response: "cancel";
extra-child: Box {
orientation: vertical;
spacing: 12;
Button reveal_button {
visible: false;
styles [
"destructive-action"
]
Adw.ButtonContent {
label: _("Reveal Potentially Sensitive Content");
icon-name: "dialog-warning-symbolic";
}
}
Button hide_button {
visible: false;
label: _("Hide Potentially Sensitive Content");
}
extra-child: Overlay {
ScrolledWindow text_view_scroll {
width-request: 500;
height-request: 250;
@ -54,5 +33,39 @@ Adw.AlertDialog clipboard_confirmation_window {
]
}
}
[overlay]
Button reveal_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"destructive-action",
]
Image {
icon-name: "view-reveal-symbolic";
}
}
[overlay]
Button hide_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"suggested-action",
]
Image {
icon-name: "view-conceal-symbolic";
}
}
};
}

View File

@ -14,28 +14,7 @@ Adw.AlertDialog clipboard_confirmation_window {
default-response: "cancel";
close-response: "cancel";
extra-child: Box {
orientation: vertical;
spacing: 12;
Button reveal_button {
visible: false;
styles [
"destructive-action"
]
Adw.ButtonContent {
label: _("Reveal Potentially Sensitive Content");
icon-name: "dialog-warning-symbolic";
}
}
Button hide_button {
visible: false;
label: _("Hide Potentially Sensitive Content");
}
extra-child: Overlay {
ScrolledWindow text_view_scroll {
width-request: 500;
height-request: 250;
@ -54,5 +33,39 @@ Adw.AlertDialog clipboard_confirmation_window {
]
}
}
[overlay]
Button reveal_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"destructive-action",
]
Image {
icon-name: "view-reveal-symbolic";
}
}
[overlay]
Button hide_button {
visible: false;
halign: end;
valign: start;
margin-end: 12;
margin-top: 12;
styles [
"suggested-action",
]
Image {
icon-name: "view-conceal-symbolic";
}
}
};
}