1
/* This file is part of GPump, a Pump.io client.
3
* GPump (THE SOFTWARE) is made available under the terms and conditions of the
4
* GNU Lesser General Public Licence 3.0. A copy of the licence can be read
5
* in the file lgpl-3.0.txt in the root of this project.
11
const Gtk = imports.gi.Gtk;
12
const _ = imports.gettext.gettext;
13
const Lang = imports.lang;
15
const AccountUI = imports.account_ui;
18
* UserMenu is a custom GtkPopover that shows the accounts that can be
19
* switched between and accsess to the user wizard/account maneger.
21
const UserMenu = new Lang.Class ({
25
_init: function (params) {
27
this["width_request"] = 300;
28
this["height_request"]= 400;
30
this.layout = new Gtk.Box ({
31
orientation: Gtk.Orientation.VERTICAL,
36
this.add (this.layout);
38
this.layout.pack_start (
39
(new Gtk.ScrolledWindow ({
40
child: (this.list_box = new Gtk.ListBox ()),
41
shadow_type: Gtk.ShadowType.ETCHED_IN
48
for (let i = 0; i <= 20; i++) {
49
this.list_box.add (new Gtk.Label ({label: "user " + i}));
52
this.layout.pack_end (
53
(this.accounts_btn = new Gtk.Button ({
54
"label": _("Accounts")
61
this.accounts_btn.connect ("clicked", Lang.bind (this, function () {
62
let account_ui = new AccountUI.AccountUI ();
64
account_ui.set_transient_for (this.get_toplevel());
68
this.connect ("show", Lang.bind (this, function () {
69
this.layout.show_all ();