Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions data/ui/application.ui
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,10 @@
</object>
</child>
<property name="title-widget">
<object class="GtkStack" id="headerbarStack">
<child>
<object class="GtkStackPage">
<property name="name">empty</property>
<property name="child">
<object class="AdwWindowTitle">
<property name="title" translatable="yes">Collision</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">switcher</property>
<property name="child">
<object class="AdwViewSwitcher">
<property name="policy">wide</property>
<property name="stack">resultsStack</property>
</object>
</property>
</object>
</child>
<object class="AdwViewSwitcher" id="headerbarViewSwitcher">
<property name="policy">wide</property>
<property name="stack">resultsStack</property>
<property name="visible">0</property>
</object>
</property>
<child type="end">
Expand Down
10 changes: 5 additions & 5 deletions src/collision/window.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Collision
"welcomeBtn",
"mainStack",
"fileInfo",
"headerbarStack",
"headerbarViewSwitcher",
"openFileBtn",
"compareBtn",
"verifyOverlayLabel",
Expand All @@ -30,7 +30,7 @@ module Collision
HOST_PATH_ATTR = "xattr::document-portal.host-path"

@hash_rows = Hash(Symbol, Widgets::HashRow).new
@headerbarStack : Gtk::Stack
@headerbarViewSwitcher : Adw::ViewSwitcher
@welcomeBtn : Gtk::Button
@compareBtn : Gtk::Button
@compareBtnImage : Gtk::Image
Expand Down Expand Up @@ -76,7 +76,7 @@ module Collision
end

@mainStack.visible_child_name = "results"
@headerbarStack.visible_child_name = "switcher"
@headerbarViewSwitcher.visible = true
@openFileBtn.visible = true
@switcher_bar.visible = true
Collision.atomic_decrease
Expand Down Expand Up @@ -140,7 +140,7 @@ module Collision
def loading
@progressbar.fraction = 0.0
@mainStack.visible_child_name = "spinner"
@headerbarStack.visible_child_name = "empty"
@headerbarViewSwitcher.visible = false
@openFileBtn.visible = false
@switcher_bar.visible = false
reset_feedback
Expand Down Expand Up @@ -269,7 +269,7 @@ module Collision
@verifyFeedback = Gtk::Image.cast(template_child("verifyFeedback"))

@mainStack = Gtk::Stack.cast(template_child("mainStack"))
@headerbarStack = Gtk::Stack.cast(template_child("headerbarStack"))
@headerbarViewSwitcher = Adw::ViewSwitcher.cast(template_child("headerbarViewSwitcher"))
@switcher_bar = Adw::ViewSwitcherBar.cast(template_child("switcher_bar"))
@mainDnd = Gtk::DropTarget.cast(template_child("mainDnd"))
@compareDnd = Gtk::DropTarget.cast(template_child("compareDnd"))
Expand Down