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.
9
* UserMenu is a custom GtkPopover that shows the accounts that can be
10
* switched between and accsess to the user wizard/account maneger.
13
const Gtk = imports.gi.Gtk;
14
const _ = imports.gettext.gettext;
15
const Lang = imports.lang;
18
const UserMenu = new Lang.Class ({
22
_init: function (params) {
24
this["width_request"] = 300;
25
this["height_request"]= 400;
27
this.layout = new Gtk.Box ({
28
orientation: Gtk.Orientation.VERTICAL,
33
this.add (this.layout);
35
this.layout.pack_start (
36
(new Gtk.ScrolledWindow ({
37
child: (this.list_box = new Gtk.ListBox ()),
38
shadow_type: Gtk.ShadowType.ETCHED_IN
45
for (let i = 0; i <= 20; i++) {
46
this.list_box.add (new Gtk.Label ({label: "user " + i}));
49
this.layout.pack_end (
50
(this.accounts_btn = new Gtk.Button ({
51
"label": _("Accounts")
58
this.accounts_btn.connect ("clicked", Lang.bind (this, function () {
62
this.connect ("show", Lang.bind (this, function () {
63
this.layout.show_all ();