Skip to content

Commit

Permalink
GNOME - Make headerbar flat when no account open
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Nov 14, 2023
1 parent a49e736 commit 4441295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions NickvisionMoney.GNOME/Blueprints/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ Adw.ApplicationWindow _root {
default-height: 720;
width-request: 360;

Adw.ToolbarView {
top-bar-style: raised;

Adw.ToolbarView _toolbarView {
[top]
Adw.HeaderBar _headerBar {
Adw.HeaderBar {
title-widget: Adw.WindowTitle _windowTitle {};

[start]
Expand Down
6 changes: 3 additions & 3 deletions NickvisionMoney.GNOME/Views/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial class MainWindow : Adw.ApplicationWindow
private readonly MainWindowController _controller;
private readonly Adw.Application _application;

[Gtk.Connect] private readonly Adw.HeaderBar _headerBar;
[Gtk.Connect] private readonly Adw.ToolbarView _toolbarView;
[Gtk.Connect] private readonly Adw.WindowTitle _windowTitle;
[Gtk.Connect] private readonly Gtk.MenuButton _accountMenuButton;
[Gtk.Connect] private readonly Gtk.Popover _accountPopover;
Expand Down Expand Up @@ -285,7 +285,7 @@ private bool OnCloseRequested(Gtk.Window sender, EventArgs e)
private async void AccountAdded(object? sender, EventArgs e)
{
_viewStack.SetVisibleChildName("pageTabs");
_headerBar.RemoveCssClass("flat");
_toolbarView.SetTopBarStyle(Adw.ToolbarStyle.Raised);
var newAccountView = new AccountView(_controller.GetMostRecentAccountViewController(), this, _tabView, _flapToggleButton, _graphToggleButton, UpdateSubtitle);
_tabView.SetSelectedPage(newAccountView.Page);
_accountViews.Add(newAccountView.Page);
Expand Down Expand Up @@ -370,7 +370,7 @@ private bool OnCloseAccountPage(Adw.TabView view, Adw.TabView.ClosePageSignalArg
if (_controller.NumberOfOpenAccounts == 0)
{
_viewStack.SetVisibleChildName("pageNoAccounts");
_headerBar.AddCssClass("flat");
_toolbarView.SetTopBarStyle(Adw.ToolbarStyle.Flat);
_accountMenuButton.SetVisible(false);
_flapToggleButton.SetVisible(false);
_graphToggleButton.SetVisible(false);
Expand Down

0 comments on commit 4441295

Please sign in to comment.