Skip to content

Commit 5985c33

Browse files
committed
Inline tabs on mobile
1 parent 8f08749 commit 5985c33

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

data/resources/ui/window.blp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ template GeopardWindow: Adw.ApplicationWindow {
6565
}
6666
}
6767
}
68-
Adw.TabBar {
68+
Adw.TabBar tab_bar {
6969
view: tab_view;
7070
}
7171
Gtk.Overlay {

src/widgets/window.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub mod imp {
5151
#[template_child]
5252
pub(crate) tab_view: TemplateChild<adw::TabView>,
5353
#[template_child]
54+
pub(crate) tab_bar: TemplateChild<adw::TabBar>,
55+
#[template_child]
5456
pub(crate) primary_menu_btn: TemplateChild<gtk::MenuButton>,
5557
pub(crate) config: RefCell<config::Config>,
5658
pub(crate) progress_animation: RefCell<Option<adw::SpringAnimation>>,
@@ -554,8 +556,13 @@ impl Window {
554556
}
555557
fn squeezer_changed(&self) {
556558
let imp = self.imp();
557-
imp.bottom_bar_revealer
558-
.set_reveal_child(self.is_small_screen());
559+
let is_small = self.is_small_screen();
560+
imp.bottom_bar_revealer.set_reveal_child(is_small);
561+
if is_small {
562+
imp.tab_bar.add_css_class("inline");
563+
} else {
564+
imp.tab_bar.remove_css_class("inline");
565+
}
559566
}
560567
fn present_shortcuts(&self) {
561568
gtk::Builder::from_resource("/com/ranfdev/Geopard/ui/shortcuts.ui");

0 commit comments

Comments
 (0)