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
1 change: 0 additions & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ src/Views/SystemView/SystemMemoryView.vala
src/Views/SystemView/SystemNetworkView.vala
src/Views/SystemView/SystemStorageView.vala
src/Views/SystemView/SystemGPUView.vala
src/Widgets/Headerbar/Headerbar.vala
src/Widgets/Headerbar/Search.vala
src/Widgets/Statusbar/Statusbar.vala
src/Widgets/WidgetResource/WidgetResource.vala
37 changes: 31 additions & 6 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {
private Resources resources;

// Widgets
public Headerbar headerbar;
public Search search { get; private set; }

public ProcessView process_view;
public SystemView system_view;
Expand Down Expand Up @@ -46,12 +46,37 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {
stack_switcher.valign = Gtk.Align.CENTER;
stack_switcher.set_stack (stack);

headerbar = new Headerbar (this);
headerbar.set_custom_title (stack_switcher);
var sv = new PreferencesView ();
headerbar.preferences_grid.add (sv);
sv.show_all ();

var preferences_popover = new Gtk.Popover (null) {
child = sv
};

var preferences_button = new Gtk.MenuButton () {
image = new Gtk.Image.from_icon_name ("open-menu", Gtk.IconSize.LARGE_TOOLBAR),
popover = preferences_popover,
tooltip_text = (_("Settings"))
};

search = new Search (this) {
valign = CENTER
};

var search_revealer = new Gtk.Revealer () {
child = search,
transition_type = SLIDE_LEFT
};

var headerbar = new Hdy.HeaderBar () {
has_subtitle = false,
show_close_button = true,
title = _("Monitor")
};
headerbar.pack_start (search_revealer);
headerbar.set_custom_title (stack_switcher);
headerbar.pack_end (preferences_button);

statusbar = new Statusbar ();

var grid = new Gtk.Grid () {
Expand All @@ -68,9 +93,9 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {

dbusserver = DBusServer.get_default ();

headerbar.search_revealer.set_reveal_child (stack.visible_child_name == "process_view");
search_revealer.set_reveal_child (stack.visible_child_name == "process_view");
stack.notify["visible-child-name"].connect (() => {
headerbar.search_revealer.set_reveal_child (stack.visible_child_name == "process_view");
search_revealer.set_reveal_child (stack.visible_child_name == "process_view");
});

new Thread<void> ("upd", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Shortcuts.vala
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public class Monitor.Shortcuts : Object {
handled = false;
char typed = e.str[0];

if (typed.isalnum () && !window.headerbar.search.is_focus) {
window.headerbar.search.activate_entry (e.str);
if (typed.isalnum () && !window.search.is_focus) {
window.search.activate_entry (e.str);
handled = true;
}

if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
switch (e.keyval) {
case Gdk.Key.f:
window.headerbar.search.activate_entry ();
window.search.activate_entry ();
handled = true;
break;
case Gdk.Key.e:
Expand Down
50 changes: 0 additions & 50 deletions src/Widgets/Headerbar/Headerbar.vala

This file was deleted.

1 change: 0 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ source_app_files = [
'Views/ProcessView/ProcessInfoView/OpenFilesTreeView.vala',

# Widgets
'Widgets/Headerbar/Headerbar.vala',
'Widgets/Headerbar/Search.vala',
'Widgets/Statusbar/Statusbar.vala',
'Widgets/Labels/LabelVertical.vala',
Expand Down