Skip to content

Commit

Permalink
Merge pull request #733 from NickvisionApps/rid-evil-error
Browse files Browse the repository at this point in the history
GNOME - Don't use Adw.ButtonContent outside a Gtk.Button
  • Loading branch information
nlogozzo authored Nov 15, 2023
2 parents 0ab1572 + 0a40b16 commit f45a305
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 10 additions & 1 deletion NickvisionMoney.GNOME/Blueprints/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,19 @@ Adw.ApplicationWindow _root {
hexpand: true;
halign: fill;

Adw.ButtonContent _greeting {
Gtk.Box {
halign: center;
margin-top: 24;
margin-bottom: 14;

Gtk.Image _greetingIcon {
pixel-size: 48;
margin-end: 12;
}

Gtk.Label _greetingLabel {
styles ["greeting-title"]
}
}

Gtk.Label _dragLabel {
Expand Down
15 changes: 4 additions & 11 deletions NickvisionMoney.GNOME/Views/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public partial class MainWindow : Adw.ApplicationWindow
[Gtk.Connect] private readonly Adw.Bin _dashboardBin;
[Gtk.Connect] private readonly Adw.ToastOverlay _toastOverlay;
[Gtk.Connect] private readonly Adw.ViewStack _viewStack;
[Gtk.Connect] private readonly Adw.ButtonContent _greeting;
[Gtk.Connect] private readonly Gtk.Image _greetingIcon;
[Gtk.Connect] private readonly Gtk.Label _greetingLabel;
[Gtk.Connect] private readonly Adw.PreferencesGroup _startPageRecentAccountsGroup;
[Gtk.Connect] private readonly Gtk.Button _newAccountButton;
[Gtk.Connect] private readonly Gtk.Button _openAccountButton;
Expand Down Expand Up @@ -87,16 +88,8 @@ private MainWindow(Gtk.Builder builder, MainWindowController controller, Adw.App
_windowTitle.SetTitle(_controller.AppInfo.ShortName);
_graphToggleButton.SetActive(_controller.ShowGraphs);
//Greeting
_greeting.SetIconName(_controller.ShowSun ? "sun-outline-symbolic" : "moon-outline-symbolic");
_greeting.SetLabel(_controller.Greeting);
var image = (Gtk.Image)_greeting.GetFirstChild();
image.SetPixelSize(48);
image.SetMarginEnd(6);
var label = (Gtk.Label)_greeting.GetLastChild();
label.AddCssClass("greeting-title");
_greeting.SetHalign(Gtk.Align.Center);
_greeting.SetMarginTop(24);
_greeting.SetMarginBottom(14);
_greetingIcon.SetFromIconName(_controller.ShowSun ? "sun-outline-symbolic" : "moon-outline-symbolic");
_greetingLabel.SetLabel(_controller.Greeting);
//Page Tabs
_tabView.OnClosePage += OnCloseAccountPage;
//New Account Action
Expand Down

0 comments on commit f45a305

Please sign in to comment.