Fix some warnings

This commit is contained in:
bleakgrey 2018-10-23 13:54:32 +03:00
parent 4a36e4154e
commit 534ff38fed
4 changed files with 12 additions and 21 deletions

View File

@ -142,11 +142,11 @@ public class Tootle.WatchlistDialog : Gtk.Window {
popover_button = new Gtk.Button.with_label (_("Add"));
popover_button.halign = Gtk.Align.END;
popover_button.margin_left = 8;
popover_button.margin_start = 6;
popover_button.clicked.connect (() => submit ());
popover_grid = new Gtk.Grid ();
popover_grid.margin = 8;
popover_grid.margin = 6;
popover_grid.attach (popover_entry, 0, 0);
popover_grid.attach (popover_button, 1, 0);
popover_grid.show_all ();

View File

@ -12,18 +12,14 @@ public class Tootle.AccountWidget : StatusWidget {
counters.visible = false;
title_acct.visible = false;
content_label.margin_bottom = 12;
button_press_event.connect(() => {
open_account ();
button_press_event.connect (ev => {
open_account (ev);
return true;
});
}
public override bool open_menu (uint button, uint32 time) {
var menu = new Gtk.Menu ();
menu.selection_done.connect (() => {
menu.detach ();
menu.destroy ();
});
var item_open_link = new Gtk.MenuItem.with_label (_("Open in Browser"));
item_open_link.activate.connect (() => Desktop.open_uri (status.url));
@ -33,8 +29,7 @@ public class Tootle.AccountWidget : StatusWidget {
menu.add (item_copy_link);
menu.show_all ();
menu.attach_widget = this;
menu.popup (null, null, null, button, time);
menu.popup_at_pointer ();
return true;
}

View File

@ -118,10 +118,6 @@ public class Tootle.AttachmentWidget : Gtk.EventBox {
public virtual bool open_menu (uint button, uint32 time) {
var menu = new Gtk.Menu ();
menu.selection_done.connect (() => {
menu.detach ();
menu.destroy ();
});
if (editable && attachment != null) {
var item_remove = new Gtk.MenuItem.with_label (_("Remove"));
@ -144,7 +140,7 @@ public class Tootle.AttachmentWidget : Gtk.EventBox {
menu.show_all ();
menu.attach_widget = this;
menu.popup (null, null, null, button, time);
menu.popup_at_pointer ();
return true;
}

View File

@ -238,7 +238,10 @@ public class Tootle.StatusWidget : Gtk.EventBox {
return null;
}
public bool open_account () {
public bool open_account (EventButton ev) {
if (ev.button == 8)
return false;
var view = new AccountView (status.get_formal ().account);
window.open_view (view);
return true;
@ -266,10 +269,6 @@ public class Tootle.StatusWidget : Gtk.EventBox {
public virtual bool open_menu (uint button, uint32 time) {
var menu = new Gtk.Menu ();
menu.selection_done.connect (() => {
menu.detach ();
menu.destroy ();
});
var is_muted = status.muted;
var item_muting = new Gtk.MenuItem.with_label (is_muted ? _("Unmute Conversation") : _("Mute Conversation"));
@ -293,6 +292,7 @@ public class Tootle.StatusWidget : Gtk.EventBox {
if (this.is_notification)
menu.add (item_muting);
menu.add (item_open_link);
menu.add (new Gtk.SeparatorMenuItem ());
menu.add (item_copy_link);
@ -300,7 +300,7 @@ public class Tootle.StatusWidget : Gtk.EventBox {
menu.show_all ();
menu.attach_widget = this;
menu.popup (null, null, null, button, time);
menu.popup_at_pointer ();
return true;
}