Skip to content

Commit

Permalink
feat: Update sidebar style
Browse files Browse the repository at this point in the history
feat: Add spinner for homepage
  • Loading branch information
tsukinaha committed Mar 30, 2024
1 parent 4c668ba commit d514bbf
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 4 deletions.
6 changes: 6 additions & 0 deletions resources/ui/home.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">9</property>
<child>
<object class="GtkSpinner" id="spinner">
<property name="spinning">True</property>
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkRevealer" id="librevealer">
<property name="transition-type">crossfade</property>
Expand Down
74 changes: 70 additions & 4 deletions resources/ui/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,21 @@
</style>
<child>
<object class="AdwActionRow" id="homerow">
<property name="title">Home</property>
<child type="prefix">
<object class="GtkLabel">
<property name="label" translatable="yes">Home</property>
<property name="halign">start</property>
<attributes>
<attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
</attributes>
</object>
</child>
<child type="prefix">
<object class="GtkImage">
<property name="icon-name">go-home-symbolic</property>
<property name="halign">start</property>
</object>
</child>
<child type="suffix">
<object class="GtkButton">
<property name="valign">center</property>
Expand All @@ -137,12 +151,50 @@
</child>
<child>
<object class="AdwActionRow">
<property name="title">History</property>
<child type="prefix">
<object class="GtkLabel">
<property name="label" translatable="yes">History</property>
<property name="halign">start</property>
<attributes>
<attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
</attributes>
</object>
</child>
<child type="prefix">
<object class="GtkImage">
<property name="icon-name">document-open-recent-symbolic</property>
<property name="halign">start</property>
</object>
</child>
<child type="suffix">
<object class="GtkButton">
<property name="valign">center</property>
<property name="icon-name">object-rotate-left</property>
<property name="action-name">win.history</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title">Search</property>
<child type="prefix">
<object class="GtkLabel">
<property name="label" translatable="yes">Search</property>
<property name="halign">start</property>
<attributes>
<attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
</attributes>
</object>
</child>
<child type="prefix">
<object class="GtkImage">
<property name="icon-name">system-search-symbolic</property>
<property name="halign">start</property>
</object>
</child>
<child type="suffix">
<object class="GtkButton">
<property name="valign">center</property>
Expand All @@ -157,7 +209,21 @@
</child>
<child>
<object class="AdwActionRow">
<property name="title">Settings</property>
<child type="prefix">
<object class="GtkLabel">
<property name="label" translatable="yes">Preferences</property>
<property name="halign">start</property>
<attributes>
<attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
</attributes>
</object>
</child>
<child type="prefix">
<object class="GtkImage">
<property name="icon-name">preferences-system-symbolic</property>
<property name="halign">start</property>
</object>
</child>
</object>
</child>
</object>
Expand Down
3 changes: 3 additions & 0 deletions src/ui/widgets/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ mod imp {
pub libsbox: TemplateChild<gtk::Box>,
#[template_child]
pub libsrevealer: TemplateChild<gtk::Revealer>,
#[template_child]
pub spinner: TemplateChild<gtk::Spinner>,
pub selection: gtk::SingleSelection,
}

Expand Down Expand Up @@ -247,6 +249,7 @@ impl HomePage {
}
}));
}
self.imp().spinner.set_visible(false);
}

pub fn set_librarysscroll(&self, latests: Vec<crate::ui::network::Latest>) -> gtk::ListView {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/widgets/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ mod imp {
klass.install_action("win.home", None, move |window, _action, _parameter| {
window.homepage();
});
klass.install_action("win.history", None, move |window, _action, _parameter| {
window.historypage();
});
klass.install_action("win.search", None, move |window, _action, _parameter| {
window.searchpage();
});
Expand Down

0 comments on commit d514bbf

Please sign in to comment.