From 2ed43354abe96cc0103ac4f2817fc0b07879ea0d Mon Sep 17 00:00:00 2001 From: Gleb Smirnov Date: Thu, 4 Aug 2022 18:43:23 +0300 Subject: [PATCH] code: Stop using Blueprint for UI The reason is bad tooling support. I hope to bring Blueprint back when the tooling will support it better. --- po/POTFILES | 5 +- resources/meson.build | 9 +- resources/ui/CustomToolPage.blp | 52 ------- resources/ui/CustomToolPage.ui | 43 ++++++ resources/ui/Editor.blp | 57 -------- resources/ui/Editor.ui | 59 ++++++++ resources/ui/NewToolPage.blp | 54 ------- resources/ui/NewToolPage.ui | 47 +++++++ resources/ui/Preferences.blp | 135 ------------------ resources/ui/Preferences.ui | 148 ++++++++++++++++++++ resources/ui/SearchBar.blp | 182 ------------------------ resources/ui/SearchBar.ui | 187 +++++++++++++++++++++++++ resources/ui/SearchEntry.blp | 41 ------ resources/ui/SearchEntry.ui | 45 ++++++ resources/ui/ShortcutsWindow.blp | 77 ---------- resources/ui/ShortcutsWindow.ui | 91 ++++++++++++ resources/ui/ToolSettings.blp | 103 -------------- resources/ui/ToolSettings.ui | 113 +++++++++++++++ resources/ui/Window.blp | 228 ------------------------------ resources/ui/Window.ui | 233 +++++++++++++++++++++++++++++++ resources/ui/meson.build | 26 ---- src/meson.build | 10 -- 22 files changed, 972 insertions(+), 973 deletions(-) delete mode 100644 resources/ui/CustomToolPage.blp create mode 100644 resources/ui/CustomToolPage.ui delete mode 100644 resources/ui/Editor.blp create mode 100644 resources/ui/Editor.ui delete mode 100644 resources/ui/NewToolPage.blp create mode 100644 resources/ui/NewToolPage.ui delete mode 100644 resources/ui/Preferences.blp create mode 100644 resources/ui/Preferences.ui delete mode 100644 resources/ui/SearchBar.blp create mode 100644 resources/ui/SearchBar.ui delete mode 100644 resources/ui/SearchEntry.blp create mode 100644 resources/ui/SearchEntry.ui delete mode 100644 resources/ui/ShortcutsWindow.blp create mode 100644 resources/ui/ShortcutsWindow.ui delete mode 100644 resources/ui/ToolSettings.blp create mode 100644 resources/ui/ToolSettings.ui delete mode 100644 resources/ui/Window.blp create mode 100644 resources/ui/Window.ui delete mode 100644 resources/ui/meson.build diff --git a/po/POTFILES b/po/POTFILES index a8938e3..6f06708 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -11,8 +11,11 @@ src/Tool.vala src/ToolSettings.vala src/Window.vala resources/ui/CustomToolPage.ui +resources/ui/Editor.ui resources/ui/NewToolPage.ui resources/ui/Preferences.ui +resources/ui/SearchBar.ui +resources/ui/SearchEntry.ui resources/ui/ShortcutsWindow.ui resources/ui/ToolSettings.ui -resources/ui/Window.ui \ No newline at end of file +resources/ui/Window.ui diff --git a/resources/meson.build b/resources/meson.build index 2e45b9c..7dabc7d 100644 --- a/resources/meson.build +++ b/resources/meson.build @@ -2,13 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -subdir('ui') - -generated_resources_dir = meson.current_build_dir() - textpieces_sources += gnome.compile_resources('textpieces-resources', 'textpieces.gresource.xml', - source_dir: ['resources', generated_resources_dir], - c_name: 'textpieces', - dependencies: blueprints + source_dir: 'resources', + c_name: 'textpieces' ) diff --git a/resources/ui/CustomToolPage.blp b/resources/ui/CustomToolPage.blp deleted file mode 100644 index 51ea5e1..0000000 --- a/resources/ui/CustomToolPage.blp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -using Adw 1; - -template TextPiecesCustomToolPage : Box { - orientation: vertical; - - Adw.HeaderBar { - show-start-title-buttons: false; - show-end-title-buttons: false; - - /* Left buttons */ - [start] - Button { - clicked => go_back(); - - icon-name: 'go-previous-symbolic'; - } - - /* Title widget */ - [title] - Label { - styles [ - 'heading' - ] - - label: _('Edit Tool'); - } - - /* Righ buttons */ - [end] - Button { - styles [ - 'destructive-action' - ] - - clicked => delete_tool(); - clicked => go_back(); - - label: _('D_elete'); - use-underline: true; - } - } - - .TextPiecesToolSettings tool_settings { - can-edit-script: true; - } -} diff --git a/resources/ui/CustomToolPage.ui b/resources/ui/CustomToolPage.ui new file mode 100644 index 0000000..53c69d2 --- /dev/null +++ b/resources/ui/CustomToolPage.ui @@ -0,0 +1,43 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/Editor.blp b/resources/ui/Editor.blp deleted file mode 100644 index 7a7ba6e..0000000 --- a/resources/ui/Editor.blp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; -using GtkSource 5; -using Adw 1; - -template TextPiecesEditor : Adw.Bin { - child: Adw.ToastOverlay message_overlay { - Overlay { - ScrolledWindow { - GtkSource.View editor { - monospace: true; - auto-indent: true; - show-line-numbers: true; - smart-backspace: true; - smart-home-end: before; - top-margin: 6; - } - } - - [overlay] - Box { - valign: start; - halign: end; - margin-top: 4; - - orientation: vertical; - spacing: 6; - - .TextPiecesSearchBar search_bar { - editor: editor; - } - - Box arguments_box { - styles [ - 'linked', - 'editor-overlay' - ] - - halign: end; - hexpand: false; - width-request: 300; - - margin-top: 5; - margin-bottom: 2.5; - margin-start: 5; - margin-end: 10; - - spacing: 3; - orientation: vertical; - } - } - } - }; -} diff --git a/resources/ui/Editor.ui b/resources/ui/Editor.ui new file mode 100644 index 0000000..a9847b8 --- /dev/null +++ b/resources/ui/Editor.ui @@ -0,0 +1,59 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/NewToolPage.blp b/resources/ui/NewToolPage.blp deleted file mode 100644 index 40f0b82..0000000 --- a/resources/ui/NewToolPage.blp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -using Adw 1; - -template TextPiecesNewToolPage : Box { - orientation: vertical; - - Adw.HeaderBar { - show-start-title-buttons: false; - show-end-title-buttons: false; - - /* Left button */ - [start] - Button { - clicked => go_back(); - - icon-name: 'go-previous-symbolic'; - } - - /* Title widget */ - [title] - Label { - styles [ - 'heading' - ] - - label: _('New Tool'); - } - - /* Right button */ - [end] - Revealer { - transition-type: crossfade; - reveal-child: bind tool_settings.is_valid; - child: Button { - styles [ - 'suggested-action' - ] - - clicked => create(); - clicked => go_back(); - - label: _('_Create'); - use-underline: true; - }; - } - } - - .TextPiecesToolSettings tool_settings { } -} diff --git a/resources/ui/NewToolPage.ui b/resources/ui/NewToolPage.ui new file mode 100644 index 0000000..b0b663d --- /dev/null +++ b/resources/ui/NewToolPage.ui @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/Preferences.blp b/resources/ui/Preferences.blp deleted file mode 100644 index 812e89c..0000000 --- a/resources/ui/Preferences.blp +++ /dev/null @@ -1,135 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -using Adw 1; -using GtkSource 5; - -template TextPiecesPreferences : Adw.PreferencesWindow { - can-navigate-back: true; - modal: true; - - Adw.PreferencesPage { - title: _('_General'); - use-underline: true; - name: 'general-settings'; - icon-name: 'preferences-symbolic'; - - Adw.PreferencesGroup { - title: _('Editor'); - - Adw.ActionRow { - title: _('Editor _Font'); - use-underline: true; - activatable: true; - action-name: 'prefs.select-font'; - - Box { - spacing: 12; - - Label font_label {} - - Image { - icon-name: 'go-next-symbolic'; - } - } - } - - Adw.ActionRow { - title: _('_Wrap Lines'); - use-underline: true; - activatable-widget: wrap_lines_switch; - - Switch wrap_lines_switch { - valign: center; - action-name: 'settings.wrap-lines'; - } - } - - Adw.ActionRow { - title: _('Tabs to _Spaces'); - use-underline: true; - activatable-widget: tabs_to_spaces; - - Switch tabs_to_spaces { - valign: center; - action-name: 'settings.tabs-to-spaces'; - } - } - - Adw.ActionRow { - title: _('_Tab Width in Spaces'); - use-underline: true; - activatable-widget: spaces_in_tab; - - SpinButton spaces_in_tab { - valign: center; - climb-rate: 1; - adjustment: Adjustment { - lower: 1; - upper: 21; - step-increment: 1; - }; - } - } - } - - Adw.PreferencesGroup { - title: _('Appearance'); - - Adw.Clamp { - maximum-size: 450; - - GtkSource.StyleSchemeChooserWidget style_scheme_chooser { } - } - } - } - - Adw.PreferencesPage { - title: _('T_ools'); - use-underline: true; - name: 'custom-tools'; - icon-name: 'applications-utilities-symbolic'; - - Adw.PreferencesGroup { - title: _('Custom tools'); - - [header-suffix] - Button { - styles [ - 'flat' - ] - - clicked => add_new_tool(); - - Adw.ButtonContent { - icon-name: 'list-add-symbolic'; - label: _('_Add custom tool'); - use-underline: true; - } - } - - ListBox custom_tools_listbox { - styles [ - 'boxed-list' - ] - - row-activated => edit_tool(); - - selection-mode: none; - } - - Adw.StatusPage { - icon-name: 'applications-utilities-symbolic'; - title: _('No Custom Tools'); - description: _('You can create one'); - - visible: bind custom_tools_listbox.visible inverted; - vexpand: true; - valign: center; - } - } - } -} diff --git a/resources/ui/Preferences.ui b/resources/ui/Preferences.ui new file mode 100644 index 0000000..e384e21 --- /dev/null +++ b/resources/ui/Preferences.ui @@ -0,0 +1,148 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/SearchBar.blp b/resources/ui/SearchBar.blp deleted file mode 100644 index b7b32fc..0000000 --- a/resources/ui/SearchBar.blp +++ /dev/null @@ -1,182 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; -using Adw 1; - -template TextPiecesSearchBar : Adw.Bin { - Revealer search_revealer { - transition-type: slide_down; - - Grid { - styles [ - 'editor-overlay' - ] - - margin-top: 5; - margin-bottom: 2.5; - margin-start: 5; - margin-end: 10; - - row-spacing: 6; - column-spacing: 6; - - .TextPiecesSearchEntry search_entry { - layout { - row: 0; - column: 0; - } - } - - Box { - styles [ - 'linked' - ] - - homogeneous: true; - - Button { - icon-name: 'go-up-symbolic'; - tooltip-text: _('Move to revious match'); - action-name: 'search.prev-match'; - } - - Button { - icon-name: 'go-down-symbolic'; - tooltip-text: _('Move to next match'); - action-name: 'search.next-match'; - } - - layout { - row: 0; - column: 1; - } - } - - ToggleButton search_replace { - icon-name: 'edit-find-replace-symbolic'; - tooltip-text: _('Find and replace'); - - layout { - row: 0; - column: 2; - } - } - - ToggleButton search_options { - icon-name: 'preferences-symbolic'; - tooltip-text: _('Toggle search options'); - - layout { - row: 0; - column: 3; - } - } - - Button { - styles [ - 'flat', - 'circular' - ] - - icon-name: 'window-close-symbolic'; - action-name: 'search.hide'; - tooltip-text: _('Close search'); - - layout { - row: 0; - column: 4; - } - } - - Entry replace_entry { - primary-icon-name: 'edit-find-replace-symbolic'; - primary-icon-activatable: false; - placeholder-text: _('Replace'); - visible: bind search_replace.active; - - changed => remove_error_style(); - - layout { - row: 1; - column: 0; - } - } - - Button { - label: _('_Replace'); - use-underline: true; - visible: bind search_replace.active; - sensitive: bind search_entry.occurrence_position; - action-name: 'search.replace'; - - layout { - row: 1; - column: 1; - } - } - - Button { - label: _('Replace _All'); - use-underline: true; - visible: bind search_replace.active; - sensitive: bind search_entry.occurrences_count; - action-name: 'search.replace-all'; - - layout { - row: 1; - column: 2; - column-span: 3; - } - } - - Box { - spacing: 6; - visible: bind search_options.active; - - CheckButton { - use-underline: true; - label: _('Re_gular expressions'); - active: bind TextPiecesSearchBar.use-regex bidirectional; - } - - CheckButton { - use-underline: true; - label: _('_Case sensitive'); - active: bind TextPiecesSearchBar.case-sensitive bidirectional; - } - - CheckButton { - use-underline: true; - label: _('Match whole _word only'); - active: bind TextPiecesSearchBar.whole-words bidirectional; - } - - layout { - row: 2; - column: 0; - column-span: 5; - } - } - } - - ShortcutController { - scope: managed; - - Shortcut { - trigger: 'Escape'; - action: 'action(search.hide)'; - } - } - } - - ShortcutController { - scope: managed; - - Shortcut { - trigger: 'f'; - action: 'action(search.show)'; - } - } -} diff --git a/resources/ui/SearchBar.ui b/resources/ui/SearchBar.ui new file mode 100644 index 0000000..0973c69 --- /dev/null +++ b/resources/ui/SearchBar.ui @@ -0,0 +1,187 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/SearchEntry.blp b/resources/ui/SearchEntry.blp deleted file mode 100644 index 06dfc0e..0000000 --- a/resources/ui/SearchEntry.blp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -template TextPiecesSearchEntry : Gtk.Widget { - width-request: 300; - - Image { - icon-name: 'edit-find-symbolic'; - } - - Text text { - placeholder-text: _('Find'); - hexpand: true; - vexpand: true; - width-chars: 12; - max-width-chars: 12; - - ShortcutController { - scope: local; - - Shortcut { - action: 'action(search.prev-match)'; - trigger: 'Return'; - } - - Shortcut { - action: 'action(search.next-match)'; - trigger: 'Return'; - } - } - } - - Label { - xalign: 1; - opacity: 0.3; - label: bind TextPiecesSearchEntry.occurrences_info; - } -} diff --git a/resources/ui/SearchEntry.ui b/resources/ui/SearchEntry.ui new file mode 100644 index 0000000..ddb10b6 --- /dev/null +++ b/resources/ui/SearchEntry.ui @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/ShortcutsWindow.blp b/resources/ui/ShortcutsWindow.blp deleted file mode 100644 index 44a8e55..0000000 --- a/resources/ui/ShortcutsWindow.blp +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -ShortcutsWindow help_overlay { - ShortcutsSection { - section-name: 'shortcuts'; - - ShortcutsGroup { - title: _('General'); - - ShortcutsShortcut { - title: _('Keyboard shortcuts'); - action-name: 'win.show-help-overlay'; - } - - ShortcutsShortcut { - title: _('Preferences'); - action-name: 'win.preferences'; - } - - ShortcutsShortcut { - title: _('Quit'); - action-name: 'window.close'; - } - } - - ShortcutsGroup { - title: _('Tools') ; - - ShortcutsShortcut { - title: _('Apply'); - action-name: 'win.apply'; - } - - ShortcutsShortcut { - title: _('Select tool'); - action-name: 'win.toggle-search'; - } - - ShortcutsShortcut { - title: _('Just to the tool options'); - action-name: 'win.jump-to-args'; - } - } - - ShortcutsGroup { - title: _('Undo and Redo'); - - ShortcutsShortcut { - title: _('Undo'); - accelerator: 'z'; - } - - ShortcutsShortcut { - title: _('Redo'); - accelerator: 'z'; - } - } - - ShortcutsGroup { - title: _('Files'); - - ShortcutsShortcut { - title: _('Load from file'); - action-name: 'win.load-file'; - } - - ShortcutsShortcut { - title: _('Save to file'); - action-name: 'win.save-as'; - } - } - } -} diff --git a/resources/ui/ShortcutsWindow.ui b/resources/ui/ShortcutsWindow.ui new file mode 100644 index 0000000..cd1b0e5 --- /dev/null +++ b/resources/ui/ShortcutsWindow.ui @@ -0,0 +1,91 @@ + + + + + + + shortcuts + + + General + + + Keyboard shortcuts + win.show-help-overlay + + + + + Preferences + win.preferences + + + + + Quit + window.close + + + + + + + Tools + + + Apply + win.apply + + + + + Select tool + win.toggle-search + + + + + Just to the tool options + win.jump-to-args + + + + + + + Undo and Redo + + + Undo + <ctrl>z + + + + + Redo + <ctrl><shift>z + + + + + + + Files + + + Load from file + win.load-file + + + + + Save to file + win.save-as + + + + + + + + \ No newline at end of file diff --git a/resources/ui/ToolSettings.blp b/resources/ui/ToolSettings.blp deleted file mode 100644 index 8d640b6..0000000 --- a/resources/ui/ToolSettings.blp +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -using Adw 1; - -template TextPiecesToolSettings : Adw.Bin { - ScrolledWindow { - Viewport { - vexpand: true; - scroll-to-focus: true; - - Adw.Clamp { - maximum-size: 400; - - Box { - orientation: vertical; - margin-top: 20; - margin-bottom: 20; - spacing: 20; - - ListBox { - styles [ - 'boxed-list' - ] - - selection-mode: none; - - Adw.ActionRow { - title: _('_Name'); - use-underline: true; - activatable-widget: name_entry; - - Entry name_entry { - activate => gtk_widget_grab_focus(description_entry); - - valign: center; - } - } - - Adw.ActionRow { - title: _('_Description'); - use-underline: true; - activatable-widget: description_entry; - - Entry description_entry { - valign: center; - } - } - - Adw.ActionRow { - title: _('_Arguments'); - use-underline: true; - activatable-widget: arguments_number; - - SpinButton arguments_number { - valign: center; - adjustment: Adjustment { - lower: 0; - upper: 100; - step-increment: 1; - value: 0; - }; - } - } - } - - ListBox edit_script_list { - styles [ - 'boxed-list' - ] - - selection-mode: none; - - Adw.ActionRow { - activated => edit_script(); - - title: _('Edit _Script'); - use-underline: true; - activatable: true; - - Image { - valign: center; - icon-name: 'document-edit-symbolic'; - } - } - } - - ListBox argument_list { - styles [ - 'boxed-list' - ] - - visible: false; - selection-mode: none; - } - } - } - } - } -} diff --git a/resources/ui/ToolSettings.ui b/resources/ui/ToolSettings.ui new file mode 100644 index 0000000..67c89cb --- /dev/null +++ b/resources/ui/ToolSettings.ui @@ -0,0 +1,113 @@ + + + + + \ No newline at end of file diff --git a/resources/ui/Window.blp b/resources/ui/Window.blp deleted file mode 100644 index feefb88..0000000 --- a/resources/ui/Window.blp +++ /dev/null @@ -1,228 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Gleb Smirnov -// -// SPDX-License-Identifier: GPL-3.0-or-later - -using Gtk 4.0; - -using Adw 1; -using GtkSource 5; - -template TextPiecesWindow : Adw.ApplicationWindow { - title: _('Text Pieces'); - focus-widget: editor; - icon-name: 'com.github.liferooter.textpieces'; - - Box { - orientation: vertical; - - Adw.HeaderBar { - /* Left buttons */ - [start] - Revealer { - transition-type: crossfade; - reveal-child: bind search_bar.search-mode-enabled inverted; - - child: Box { - styles [ - 'linked' - ] - - Button { - styles [ - 'suggested-action' - ] - - label: _('_Apply'); - use-underline: true; - action-name: 'win.apply'; - tooltip-text: _('Apply Selected Tool'); - } - - Button { - styles [ - 'suggested-action' - ] - - icon-name: 'edit-copy-symbolic'; - action-name: 'win.copy'; - tooltip-text: _('Copy'); - } - }; - } - - /* Title widget */ - [title] - ToggleButton tool_button { - styles [ - 'flat', - 'heading' - ] - - toggled => on_search_toggled(); - - child: Adw.ButtonContent tool_button_content { - /* Label and icon of this button are defined in code */ - }; - } - - /* Right buttons */ - /* Don't forget that end children have reverse order */ - [end] - MenuButton { - icon-name: 'open-menu-symbolic'; - menu-model: app-menu; - tooltip-text: _('Main Menu'); - primary: true; - } - - [end] - Button { - icon-name: 'document-save-symbolic'; - tooltip-text: _('Save to File'); - action-name: 'win.save-as'; - } - - [end] - Button { - icon-name: 'document-open-symbolic'; - tooltip-text: _('Load from File'); - action-name: 'win.load-file'; - } - } - - SearchBar search_bar { - search-mode-enabled: bind tool_button.active bidirectional; - - child: SearchEntry search_entry { - changed => update_search_results(); - activate => on_search_activated(); - - EventControllerKey search_event_controller { - key-pressed => on_search_entry_key(); - } - }; - } - - Stack content_stack { - vexpand: true; - transition-type: crossfade; - - StackPage { - name: 'editor'; - - child: .TextPiecesEditor editor { - vexpand: true; - }; - } - - StackPage { - name: 'search'; - - child: Stack search_stack { - transition-type: crossfade; - - StackPage { - name: 'search'; - - child: ScrolledWindow { - child: Viewport search_viewport { - scroll-to-focus: true; - - Adw.Clamp { - maximum-size: 600; - - ListBox search_listbox { - styles ['boxed-list'] - - row-activated => on_row_activated(); - - margin-top: 24; - margin-bottom: 24; - valign: start; - selection-mode: browse; - } - } - }; - }; - } - - StackPage { - name: 'placeholder'; - - child: Adw.StatusPage { - icon-name: 'applications-utilities-symbolic'; - title: _('No Tools Found'); - - Button { - styles [ - 'flat' - ] - - halign: center; - action-name: 'win.tools-settings'; - child: Box { - spacing: 8; - - Image { - styles [ - 'dim-label' - ] - - icon-name: 'list-add-symbolic'; - } - - Label { - styles [ - 'dim-label' - ] - - label: _('Add Custom Tool'); - } - }; - } - }; - } - }; - } - } - } -} - - -menu app-menu { - section { - item { - label: _('_New Window'); - action: 'app.new-window'; - use-underline: true; - } - } - - section { - item { - label: _('_Find/Replaceā€¦'); - action: 'win.find'; - use-underline: true; - } - } - - section { - item { - label: _('_Preferences'); - action: 'win.open-preferences'; - use-underline: true; - } - - item { - label: _('_Keyboard Shortcuts'); - action: 'win.show-help-overlay'; - use-underline: true; - } - - item { - label: _('_About Text Pieces'); - action: 'win.about'; - use-underline: true; - } - } -} diff --git a/resources/ui/Window.ui b/resources/ui/Window.ui new file mode 100644 index 0000000..d2a041c --- /dev/null +++ b/resources/ui/Window.ui @@ -0,0 +1,233 @@ + + + + + +
+ + _New Window + app.new-window + true + +
+
+ + _Find/Replaceā€¦ + win.find + true + +
+
+ + _Preferences + win.open-preferences + true + + + _Keyboard Shortcuts + win.show-help-overlay + true + + + _About Text Pieces + win.about + true + +
+
+
\ No newline at end of file diff --git a/resources/ui/meson.build b/resources/ui/meson.build deleted file mode 100644 index 653164e..0000000 --- a/resources/ui/meson.build +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Gleb Smirnov -# -# SPDX-License-Identifier: GPL-3.0-or-later - -blueprint_files = [ - 'Editor.blp', - 'NewToolPage.blp', - 'CustomToolPage.blp', - 'Preferences.blp', - 'ShortcutsWindow.blp', - 'SearchBar.blp', - 'SearchEntry.blp', - 'ToolSettings.blp', - 'Window.blp' -] - -blueprint_ui = [] -foreach b : blueprint_files - blueprint_ui += b.replace('.blp', '.ui') -endforeach - -blueprints = custom_target('blueprints', - input: blueprint_files, - output: blueprint_ui, - command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], -) diff --git a/src/meson.build b/src/meson.build index 70177db..691eafa 100644 --- a/src/meson.build +++ b/src/meson.build @@ -19,13 +19,6 @@ textpieces_sources += [ 'Window.vala', ] -textpieces_sources += custom_target('blueprint-hack', - input: blueprints, - output: 'blueprint.vala', - command: [find_program('touch'), '@OUTPUT@'], - build_always: true -) - executable('textpieces', textpieces_sources, c_args: [ '-DVERSION="' + meson.project_version() + '"', @@ -34,9 +27,6 @@ executable('textpieces', textpieces_sources, '-DGETTEXT_PACKAGE="' + meson.project_name() + '"', '-DGNOMELOCALEDIR="' + get_option('prefix') / get_option('localedir') + '"', ], - vala_args: [ - '--gresourcesdir=' + generated_resources_dir - ], dependencies: textpieces_deps, install: true, )