Merge branch 'master' of ssh://forge.chapril.org:222/Monito/monito

This commit is contained in:
Benjamin Drieu 2021-11-17 21:01:54 +01:00
commit 9317c4cb7a
2 changed files with 42 additions and 1 deletions

View File

@ -212,10 +212,31 @@ class Indicator extends PanelMenu.Button {
this.setupTimeout ( ); this.setupTimeout ( );
} }
createHeaderBin ( status, text, col ) {
let _widths = [ 300, 300, 200, 50, 600 ];
let _bin = new St.Bin({
style_class: 'monito-service-' + status,
width: _widths[col],
x_expand: ( col == 4 ? true : false ),
child: new St.Button ( {
x_align: Clutter.ActorAlign.FILL,
y_align: Clutter.ActorAlign.CENTER,
reactive: true,
can_focus: true,
track_hover: true,
accessible_name: text,
style_class: 'button',
label: 'Foo',
})
});
return _bin;
}
createBin ( status, text, col ) { createBin ( status, text, col ) {
let _widths = [ 300, 300, 200, 50, 600 ]; let _widths = [ 300, 300, 200, 50, 600 ];
let _bin = new St.Bin({ let _bin = new St.Bin({
style_class: 'monito-service-' + status, style_class: 'monito-service-' + status,
track_hover: true,
width: _widths[col], width: _widths[col],
x_expand: ( col == 4 ? true : false ), x_expand: ( col == 4 ? true : false ),
child: new St.Label({ style_class: 'monito-label', text: text }) child: new St.Label({ style_class: 'monito-label', text: text })
@ -228,6 +249,19 @@ class Indicator extends PanelMenu.Button {
this._box.remove_all_children(); this._box.remove_all_children();
let headerBox = new St.BoxLayout({
style_class: 'monito-service-line',
hover: true,
x_expand: true
});
this._box.add_child(headerBox);
headerBox.add_child ( this.createHeaderBin ( '', 'Foo', 0 ) );
headerBox.add_child ( this.createHeaderBin ( '', 'Foo', 1 ) );
headerBox.add_child ( this.createHeaderBin ( '', 'Foo', 2 ) );
headerBox.add_child ( this.createHeaderBin ( '', 'Foo', 3 ) );
headerBox.add_child ( this.createHeaderBin ( '', 'Foo', 4 ) );
for ( let i = 0 ; i < serverLogic.status.service_status.length ; i ++ ) for ( let i = 0 ; i < serverLogic.status.service_status.length ; i ++ )
{ {
_status [ serverLogic.status.service_status[i].status ] ++; _status [ serverLogic.status.service_status[i].status ] ++;
@ -285,7 +319,7 @@ class Indicator extends PanelMenu.Button {
can_focus: true, can_focus: true,
track_hover: true, track_hover: true,
accessible_name: text, accessible_name: text,
style_class: 'button' style_class: 'button',
}); });
button.child = new St.Icon({ button.child = new St.Icon({

View File

@ -189,6 +189,13 @@ function createAccountWidgets ( isActive )
this.prefWidgets = { }; this.prefWidgets = { };
this._accountsWidget.attach ( new Gtk.Label({
label: '<b>' + _('Accounts settings') + '</b>',
visible: true,
halign: Gtk.Align.START,
use_markup: true,
}), 0, 0, 2, 1 );
let y = 1; let y = 1;
for ( var prefEntry of prefs ) for ( var prefEntry of prefs )
{ {