Skip to content

Commit

Permalink
improved app design using splitview
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Jul 1, 2024
1 parent 3d34500 commit 63d1fb3
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 187 deletions.
1 change: 1 addition & 0 deletions data/ascii-draw.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<file preprocess="xml-stripblanks">icons/16x16/actions/line-style-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/edit-undo-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/fill-tool-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/right-large-symbolic.svg</file>

<file preprocess="xml-stripblanks">ui/eraser_sidebar.ui</file>
<file preprocess="xml-stripblanks">ui/freehand_sidebar.ui</file>
Expand Down
2 changes: 2 additions & 0 deletions data/icons/16x16/actions/right-large-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion data/style-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
linear-gradient(to bottom, #333333 1px, transparent 1px);
box-shadow:
inset 0px 0px 0px 1px #555555,
0px 0px 10px 10px @headerbar_shade_color;
0px 0px 6px 6px @headerbar_shade_color;
opacity:0.4;
}
2 changes: 1 addition & 1 deletion data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
linear-gradient(to bottom, #aaaaaa 1px, transparent 1px);
box-shadow:
inset 0px 0px 0px 1px #777777,
0px 0px 10px 10px @headerbar_shade_color;
0px 0px 6px 6px @headerbar_shade_color;
opacity:0.4;
}
.ascii {
Expand Down
1 change: 0 additions & 1 deletion data/ui/unicode_tooltip.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="char_label">
<!-- <property name="css-classes">title-4</property> -->
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
</object>
Expand Down
387 changes: 213 additions & 174 deletions data/ui/window.ui

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@
class AsciiDrawWindow(Adw.ApplicationWindow):
__gtype_name__ = 'AsciiDrawWindow'

overlay_split_view = Gtk.Template.Child()

toast_overlay = Gtk.Template.Child()
chars_carousel = Gtk.Template.Child()
char_group_label = Gtk.Template.Child()
char_carousel_go_back = Gtk.Template.Child()
char_carousel_go_next = Gtk.Template.Child()

# Headerbar
undo_button = Gtk.Template.Child()
redo_button = Gtk.Template.Child()
save_import_button = Gtk.Template.Child()
title_widget = Gtk.Template.Child()

# Tools
free_button = Gtk.Template.Child()
rectangle_button = Gtk.Template.Child()
filled_rectangle_button = Gtk.Template.Child()
Expand All @@ -63,15 +65,16 @@ class AsciiDrawWindow(Adw.ApplicationWindow):
primary_char_button = Gtk.Template.Child()
secondary_char_button = Gtk.Template.Child()

save_import_button = Gtk.Template.Child()
lines_styles_box = Gtk.Template.Child()

# Sidebar
sidebar_stack = Gtk.Template.Child()

sidebar_stack_switcher = Gtk.Template.Child()
chars_carousel = Gtk.Template.Child()
char_group_label = Gtk.Template.Child()
char_carousel_go_back = Gtk.Template.Child()
char_carousel_go_next = Gtk.Template.Child()
lines_styles_box = Gtk.Template.Child()

title_widget = Gtk.Template.Child()

# Canvas side popover
width_spin = Gtk.Template.Child()
height_spin = Gtk.Template.Child()

Expand Down Expand Up @@ -623,6 +626,10 @@ def undo_first_change(self, *args):
def redo_last_change(self, *args):
self.canvas.redo()

@Gtk.Template.Callback("close_sidebar")
def close_sidebar(self, *args):
self.overlay_split_view.set_show_sidebar(False)

def select_rectangle_tool(self):
self.rectangle_button.set_active(True)

Expand Down

0 comments on commit 63d1fb3

Please sign in to comment.