Skip to content

Commit

Permalink
Merge pull request #151 from TenderOwl/adwaita-1.4
Browse files Browse the repository at this point in the history
Adwaita 1.4
  • Loading branch information
amka authored Sep 29, 2023
2 parents 8de5f59 + 8b791d0 commit 471d577
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 213 deletions.
175 changes: 68 additions & 107 deletions data/ui/extracted_page.blp
Original file line number Diff line number Diff line change
@@ -1,132 +1,93 @@
using Gtk 4.0;
using Adw 1;

template $ExtractedPage : Box {
orientation: vertical;
template $ExtractedPage : Adw.NavigationPage {
title: "Extracted";

Adw.HeaderBar headerbar {
Adw.ToolbarView {

[title]
Label {}
[top]
Adw.HeaderBar headerbar {

[start]
Button back_btn {
icon-name: "go-previous-symbolic";
tooltip-text: C_("Extracted screen", "Back");
clicked => $_on_back_btn_clicked();
[title]
Label {}

styles ["icon-button", "back"]
}

[start]
Adw.SplitButton grab_btn {
action-name: "app.get_screenshot";
tooltip-text: C_("Extracted screen", "Take a screenshot");
menu-model: grab_menu;

child: Adw.ButtonContent {
label: "_Grab";
use-underline: true;
[start]
Adw.SplitButton grab_btn {
action-name: "app.get_screenshot";
tooltip-text: _("Take a screenshot");
icon-name: "camera-photo-symbolic";
};
}
menu-model: grab_menu;
}

// [start]
// Button {
// action-name: "app.open_image";
// tooltip-markup: _("Open Image to extract text");

// styles ["icon-button"]

// child: Adw.ButtonContent {
// icon-name: "folder-open-symbolic";
// };
// }
[start]
Button text_copy_btn {
action-name: "app.copy_to_clipboard";
tooltip-text: C_("Extracted screen", "Copy extracted text to clipboard");
icon-name: "edit-copy-symbolic";
}
[start]
Button text_copy_btn {
action-name: "app.copy_to_clipboard";
tooltip-text: C_("Extracted screen", "Copy extracted text to clipboard");
icon-name: "edit-copy-symbolic";
}

[start]
Button listen_btn {
action-name: "app.listen";
tooltip-text: C_("Extracted screen", "Listen to text");
icon-name: "audio-speakers-symbolic";
}
[start]
Button listen_btn {
action-name: "app.listen";
tooltip-text: C_("Extracted screen", "Listen to text");
icon-name: "audio-speakers-symbolic";
}

[start]
Button listen_cancel_btn {
action-name: "app.listen_cancel";
tooltip-text: C_("Extracted screen", "Cancel listening to text");
icon-name: "media-playback-stop-symbolic";
visible: false;
}
[start]
Button listen_cancel_btn {
action-name: "app.listen_cancel";
tooltip-text: C_("Extracted screen", "Cancel listening to text");
icon-name: "media-playback-stop-symbolic";
visible: false;
}

[start]
Spinner listen_spinner {
spinning: false;
}
[start]
Spinner listen_spinner {
spinning: false;
}

[end]
MenuButton {
icon-name: "open-menu-symbolic";
tooltip-text: C_("Extracted screen", "Open menu");
menu-model: primary_menu;
}
[end]
MenuButton {
icon-name: "open-menu-symbolic";
tooltip-text: C_("Extracted screen", "Open menu");
menu-model: primary_menu;
}

[end]
MenuButton share_button {
icon-name: "emblem-shared-symbolic";
tooltip-text: C_("Extracted screen", "Share To");
popover: Popover {
[end]
MenuButton share_button {
icon-name: "emblem-shared-symbolic";
tooltip-text: C_("Extracted screen", "Share To");
popover: Popover {

styles ["menu"]
styles ["menu"]

child: ListBox share_list_box {
margin-end: 4;
margin-top: 4;
margin-start: 4;
margin-bottom: 4;
child: ListBox share_list_box {
margin-end: 4;
margin-top: 4;
margin-start: 4;
margin-bottom: 4;
};
};
};
}
}

ScrolledWindow text_scrollview {
hexpand: true;
vexpand: true;

TextView text_view {
left-margin: 12;
right-margin: 12;
top-margin: 12;
bottom-margin: 12;
pixels-above-lines: 4;
pixels-below-lines: 4;
wrap-mode: char;

buffer: TextBuffer buffer {};

}
}
}

Revealer toolbox {
transition-type: slide_up;
child: Box {
orientation: vertical;
ScrolledWindow text_scrollview {
hexpand: true;
vexpand: true;

Separator {}
TextView text_view {
left-margin: 12;
right-margin: 12;
top-margin: 12;
bottom-margin: 12;
pixels-above-lines: 4;
pixels-below-lines: 4;
wrap-mode: char;

Box {
margin-start: 8;
margin-end: 8;
margin-top: 8;
margin-bottom: 8;
spacing: 8;
buffer: TextBuffer buffer {};
}
};
}
}
}

Expand Down
148 changes: 76 additions & 72 deletions data/ui/welcome_page.blp
Original file line number Diff line number Diff line change
@@ -1,96 +1,100 @@
using Gtk 4.0;
using Adw 1;

template $WelcomePage : Box {
orientation: vertical;
template $WelcomePage : Adw.NavigationPage {
title: "Welcome";

Adw.HeaderBar {
visible: true;
tooltip-text: _("Extract text from anywhere");
Adw.ToolbarView {

[title]
Adw.WindowTitle {
title: "Frog";
}

[start]
MenuButton lang_combo {
label: _("Language");
tooltip-text: _("Select language to extract");
popover: $LanguagePopover language_popover {};
}
[top]
Adw.HeaderBar {
visible: true;
tooltip-text: _("Extract text from anywhere");

[start]
Adw.SplitButton grab_btn {
action-name: "app.get_screenshot";
tooltip-text: _("Take a screenshot");
icon-name: "camera-photo-symbolic";
menu-model: grab_menu;
}
[title]
Adw.WindowTitle {
title: "Frog";
}

[start]
Spinner spinner {
spinning: false;
}
[start]
MenuButton lang_combo {
label: _("Language");
tooltip-text: _("Select language to extract");
popover: $LanguagePopover language_popover {};
}

[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
tooltip-text: _("Open menu");
}
}
[start]
Adw.SplitButton grab_btn {
action-name: "app.get_screenshot";
tooltip-text: _("Take a screenshot");
icon-name: "camera-photo-symbolic";
menu-model: grab_menu;
}

Adw.StatusPage welcome {
title: "Frog";
description: _("Extract text from anywhere");
[start]
Spinner spinner {
spinning: false;
}

Adw.Clamp {
maximum-size: 240;
child: Box {
orientation: vertical;
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
tooltip-text: _("Open menu");
}
}

Button {
action-name: "app.get_screenshot";
tooltip-text: C_("Welcome screen", "Take a Screenshot");
Adw.StatusPage welcome {
title: "Frog";
description: _("Extract text from anywhere");

styles ["pill"]
Adw.Clamp {
maximum-size: 240;
child: Box {
halign: center;
spacing: 6;

Image {
icon-name: "camera-photo-symbolic";
orientation: vertical;

Button {
action-name: "app.get_screenshot";
tooltip-text: C_("Welcome screen", "Take a Screenshot");

styles ["pill"]
child: Box {
halign: center;
spacing: 6;

Image {
icon-name: "camera-photo-symbolic";
}

Label {
label: _("_Take a Screenshot");
use-underline: true;
}
};
}

Label {
label: _("_Take a Screenshot");
use-underline: true;
}
};
}
Button {
action-name: "app.open_image";
tooltip-text: C_("Welcome screen", "Open Image");
styles ["pill"]

Button {
action-name: "app.open_image";
tooltip-text: C_("Welcome screen", "Open Image");
styles ["pill"]
child: Box {
halign: center;
spacing: 6;

child: Box {
halign: center;
spacing: 6;
Image {
icon-name: "folder-open-symbolic";
}

Image {
icon-name: "folder-open-symbolic";
}

Label {
label: _("_Open Image");
use-underline: true;
Label {
label: _("_Open Image");
use-underline: true;
}
};
}
};
}
};
}
}
}
}

Expand Down
Loading

0 comments on commit 471d577

Please sign in to comment.