Skip to content

Commit

Permalink
code: Stop using Blueprint for UI
Browse files Browse the repository at this point in the history
The reason is bad tooling support. I hope to bring Blueprint back when
the tooling will support it better.
  • Loading branch information
liferooter committed Aug 4, 2022
1 parent d985bd1 commit 2ed4335
Show file tree
Hide file tree
Showing 22 changed files with 972 additions and 973 deletions.
5 changes: 4 additions & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
resources/ui/Window.ui
9 changes: 2 additions & 7 deletions resources/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
52 changes: 0 additions & 52 deletions resources/ui/CustomToolPage.blp

This file was deleted.

43 changes: 43 additions & 0 deletions resources/ui/CustomToolPage.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TextPiecesCustomToolPage" parent="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-start-title-buttons">false</property>
<property name="show-end-title-buttons">false</property>
<child type="start">
<object class="GtkButton">
<signal name="clicked" handler="go_back"/>
<property name="icon-name">go-previous-symbolic</property>
</object>
</child>
<child type="title">
<object class="GtkLabel">
<style>
<class name="heading"/>
</style>
<property name="label" translatable="true">Edit Tool</property>
</object>
</child>
<child type="end">
<object class="GtkButton">
<style>
<class name="destructive-action"/>
</style>
<signal name="clicked" handler="delete_tool"/>
<signal name="clicked" handler="go_back"/>
<property name="label" translatable="true">D_elete</property>
<property name="use-underline">true</property>
</object>
</child>
</object>
</child>
<child>
<object class="TextPiecesToolSettings" id="tool_settings">
<property name="can-edit-script">true</property>
</object>
</child>
</template>
</interface>
57 changes: 0 additions & 57 deletions resources/ui/Editor.blp

This file was deleted.

59 changes: 59 additions & 0 deletions resources/ui/Editor.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TextPiecesEditor" parent="AdwBin">
<property name="child">
<object class="AdwToastOverlay" id="message_overlay">
<child>
<object class="GtkOverlay">
<child>
<object class="GtkScrolledWindow">
<child>
<object class="GtkSourceView" id="editor">
<property name="monospace">true</property>
<property name="auto-indent">true</property>
<property name="show-line-numbers">true</property>
<property name="smart-backspace">true</property>
<property name="smart-home-end">before</property>
<property name="top-margin">6</property>
</object>
</child>
</object>
</child>
<child type="overlay">
<object class="GtkBox">
<property name="valign">start</property>
<property name="halign">end</property>
<property name="margin-top">4</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="TextPiecesSearchBar" id="search_bar">
<property name="editor">editor</property>
</object>
</child>
<child>
<object class="GtkBox" id="arguments_box">
<style>
<class name="linked"/>
<class name="editor-overlay"/>
</style>
<property name="halign">end</property>
<property name="hexpand">false</property>
<property name="width-request">300</property>
<property name="margin-top">5</property>
<property name="margin-bottom">2.5</property>
<property name="margin-start">5</property>
<property name="margin-end">10</property>
<property name="spacing">3</property>
<property name="orientation">vertical</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</template>
</interface>
54 changes: 0 additions & 54 deletions resources/ui/NewToolPage.blp

This file was deleted.

47 changes: 47 additions & 0 deletions resources/ui/NewToolPage.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TextPiecesNewToolPage" parent="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-start-title-buttons">false</property>
<property name="show-end-title-buttons">false</property>
<child type="start">
<object class="GtkButton">
<signal name="clicked" handler="go_back"/>
<property name="icon-name">go-previous-symbolic</property>
</object>
</child>
<child type="title">
<object class="GtkLabel">
<style>
<class name="heading"/>
</style>
<property name="label" translatable="true">New Tool</property>
</object>
</child>
<child type="end">
<object class="GtkRevealer">
<property name="transition-type">crossfade</property>
<property name="reveal-child" bind-source="tool_settings" bind-property="is_valid" bind-flags="sync-create"/>
<property name="child">
<object class="GtkButton">
<style>
<class name="suggested-action"/>
</style>
<signal name="clicked" handler="create"/>
<signal name="clicked" handler="go_back"/>
<property name="label" translatable="true">_Create</property>
<property name="use-underline">true</property>
</object>
</property>
</object>
</child>
</object>
</child>
<child>
<object class="TextPiecesToolSettings" id="tool_settings"></object>
</child>
</template>
</interface>
Loading

0 comments on commit 2ed4335

Please sign in to comment.