Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using large non-symbolic headerbar icons #201

Merged
merged 1 commit into from
Dec 8, 2021
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
46 changes: 2 additions & 44 deletions src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,8 @@ public class Iridium.Widgets.HeaderBar : Hdy.HeaderBar {
}

construct {
var join_button = new Gtk.MenuButton ();
join_button.set_image (new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.BUTTON));
join_button.tooltip_text = _("Join");
join_button.relief = Gtk.ReliefStyle.NONE;
join_button.valign = Gtk.Align.CENTER;

var new_server_connection_accellabel = new Granite.AccelLabel.from_action_name (
_("New Server Connection…"),
Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_NEW_SERVER_CONNECTION
);

var new_server_connection_menu_item = new Gtk.ModelButton ();
new_server_connection_menu_item.action_name = Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_NEW_SERVER_CONNECTION;
new_server_connection_menu_item.get_child ().destroy ();
new_server_connection_menu_item.add (new_server_connection_accellabel);

var join_channel_accellabel = new Granite.AccelLabel.from_action_name (
_("Join Channel…"),
Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_JOIN_CHANNEL
);

var join_channel_menu_item = new Gtk.ModelButton ();
join_channel_menu_item.action_name = Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_JOIN_CHANNEL;
join_channel_menu_item.get_child ().destroy ();
join_channel_menu_item.add (join_channel_accellabel);

var join_popover_grid = new Gtk.Grid ();
join_popover_grid.margin_top = 3;
join_popover_grid.margin_bottom = 3;
join_popover_grid.orientation = Gtk.Orientation.VERTICAL;
join_popover_grid.width_request = 200;
join_popover_grid.attach (new_server_connection_menu_item, 0, 0, 1, 1);
join_popover_grid.attach (join_channel_menu_item, 0, 1, 1, 1);
join_popover_grid.show_all ();

var join_popover = new Gtk.Popover (null);
join_popover.add (join_popover_grid);

join_button.popover = join_popover;

channel_users_button = new Gtk.MenuButton ();
channel_users_button.set_image (new Gtk.Image.from_icon_name ("system-users-symbolic", Gtk.IconSize.BUTTON));
channel_users_button.set_image (new Gtk.Image.from_icon_name ("system-users", Gtk.IconSize.LARGE_TOOLBAR));
channel_users_button.tooltip_text = _("Channel users"); // TODO: Enable accelerator
channel_users_button.relief = Gtk.ReliefStyle.NONE;
channel_users_button.valign = Gtk.Align.CENTER;
Expand All @@ -84,7 +44,7 @@ public class Iridium.Widgets.HeaderBar : Hdy.HeaderBar {
channel_users_button.popover = channel_users_popover;

var settings_button = new Gtk.MenuButton ();
settings_button.image = new Gtk.Image.from_icon_name ("preferences-system-symbolic", Gtk.IconSize.BUTTON);
settings_button.image = new Gtk.Image.from_icon_name ("open-menu", Gtk.IconSize.LARGE_TOOLBAR);
settings_button.tooltip_text = _("Menu");
settings_button.relief = Gtk.ReliefStyle.NONE;
settings_button.valign = Gtk.Align.CENTER;
Expand Down Expand Up @@ -148,8 +108,6 @@ public class Iridium.Widgets.HeaderBar : Hdy.HeaderBar {
pack_end (settings_button);
pack_end (channel_users_button);
pack_end (new Gtk.Separator (Gtk.Orientation.VERTICAL));
pack_start (join_button);
pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
}

private Gtk.Separator create_menu_separator (int margin_top = 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/SidePanel/Panel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public class Iridium.Widgets.SidePanel.Panel : Gtk.Grid {
item_selected (item);
});

add (source_list);
// add (status_bar);
attach (source_list, 0, 0);
attach (status_bar, 0, 1);
}

public void add_server_row (string server_name, string? network_name) {
Expand Down
75 changes: 36 additions & 39 deletions src/Widgets/StatusBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,51 @@

public class Iridium.Widgets.StatusBar : Gtk.ActionBar {

private Gtk.MenuItem channel_join_menu_item;

construct {
var server_connect_menu_item = new Gtk.MenuItem.with_label (_("Connect to a Server…"));
channel_join_menu_item = new Gtk.MenuItem.with_label (_("Join a Channel…"));

var menu = new Gtk.Menu ();
menu.append (server_connect_menu_item);
menu.append (channel_join_menu_item);
menu.show_all ();
get_style_context ().add_class (Gtk.STYLE_CLASS_INLINE_TOOLBAR);

var add_menu_button = new Gtk.MenuButton ();
add_menu_button.direction = Gtk.ArrowType.UP;
add_menu_button.popup = menu;
add_menu_button.tooltip_text = _("Join a Server or Channel");
add_menu_button.add (new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.MENU));
add_menu_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
var server_connect_accellabel = new Granite.AccelLabel.from_action_name (
_("New Server Connection…"),
Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_NEW_SERVER_CONNECTION
);

var manage_connections_button = new Gtk.Button.from_icon_name ("edit-symbolic", Gtk.IconSize.MENU);
manage_connections_button.tooltip_text = _("Manage connections…");
manage_connections_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
var server_connect_menu_item = new Gtk.ModelButton ();
server_connect_menu_item.action_name = Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_NEW_SERVER_CONNECTION;
server_connect_menu_item.get_child ().destroy ();
server_connect_menu_item.add (server_connect_accellabel);

pack_start (add_menu_button);
// pack_end (manage_connections_button);
var channel_join_accellabel = new Granite.AccelLabel.from_action_name (
_("Join Channel…"),
Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_JOIN_CHANNEL
);

server_connect_menu_item.activate.connect (() => {
server_connect_button_clicked ();
});
var channel_join_menu_item = new Gtk.ModelButton ();
channel_join_menu_item.action_name = Iridium.Services.ActionManager.ACTION_PREFIX + Iridium.Services.ActionManager.ACTION_JOIN_CHANNEL;
channel_join_menu_item.get_child ().destroy ();
channel_join_menu_item.add (channel_join_accellabel);

channel_join_menu_item.activate.connect (() => {
channel_join_button_clicked ();
});
var join_popover_grid = new Gtk.Grid ();
join_popover_grid.margin_top = 3;
join_popover_grid.margin_bottom = 3;
join_popover_grid.orientation = Gtk.Orientation.VERTICAL;
join_popover_grid.width_request = 200;
join_popover_grid.attach (server_connect_menu_item, 0, 0, 1, 1);
join_popover_grid.attach (channel_join_menu_item, 0, 1, 1, 1);
join_popover_grid.show_all ();

manage_connections_button.clicked.connect (() => {
manage_connections_button_clicked ();
});
}
var join_popover = new Gtk.Popover (null);
join_popover.add (join_popover_grid);

public void enable_channel_join_item () {
channel_join_menu_item.sensitive = true;
}
var add_menu_button = new Gtk.MenuButton ();
add_menu_button.label = _("Join…");
add_menu_button.direction = Gtk.ArrowType.UP;
add_menu_button.popover = join_popover;
add_menu_button.tooltip_text = _("Join a Server or Channel");
add_menu_button.image = new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
add_menu_button.always_show_image = true;
add_menu_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);

public void disable_channel_join_item () {
channel_join_menu_item.sensitive = false;
pack_start (add_menu_button);
}

public signal void server_connect_button_clicked ();
public signal void channel_join_button_clicked ();
public signal void manage_connections_button_clicked ();

}