Better handling of spinners
This commit is contained in:
parent
5cfb752943
commit
85293000a5
20
extension.js
20
extension.js
@ -215,8 +215,7 @@ class Indicator extends PanelMenu.Button {
|
|||||||
if ( ! widget )
|
if ( ! widget )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widget.prevChild = widget.get_child ( );
|
let _size = widget.get_child().width;
|
||||||
let _size = widget.prevChild.width;
|
|
||||||
|
|
||||||
let _child = new St.Icon({
|
let _child = new St.Icon({
|
||||||
style_class: 'monito-button-icon',
|
style_class: 'monito-button-icon',
|
||||||
@ -232,16 +231,24 @@ class Indicator extends PanelMenu.Button {
|
|||||||
_transition.set_from ( 0 );
|
_transition.set_from ( 0 );
|
||||||
_transition.set_to ( 360 );
|
_transition.set_to ( 360 );
|
||||||
|
|
||||||
|
widget.set_child ( _child );
|
||||||
_child.set_pivot_point ( .5, .5 );
|
_child.set_pivot_point ( .5, .5 );
|
||||||
_child.add_transition ( 'rotation', _transition );
|
_child.add_transition ( 'rotation', _transition );
|
||||||
|
|
||||||
widget.set_child ( _child );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stopChildSpin ( widget )
|
stopChildSpin ( widget )
|
||||||
{
|
{
|
||||||
widget.remove_all_children ( );
|
let _size = widget.get_child().width;
|
||||||
widget.set_child ( widget.prevChild );
|
|
||||||
|
widget.get_child().get_transition('rotation').stop();
|
||||||
|
|
||||||
|
widget.child = new St.Icon({
|
||||||
|
style_class: 'monito-button-icon',
|
||||||
|
icon_name: widget.prevIcon,
|
||||||
|
icon_size: _size,
|
||||||
|
width: _size,
|
||||||
|
height: _size,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createHeaderBin ( colName ) {
|
createHeaderBin ( colName ) {
|
||||||
@ -545,6 +552,7 @@ class Indicator extends PanelMenu.Button {
|
|||||||
style_class: 'button big-button',
|
style_class: 'button big-button',
|
||||||
rotation_angle_x: 0.0,
|
rotation_angle_x: 0.0,
|
||||||
});
|
});
|
||||||
|
button.prevIcon = icon;
|
||||||
|
|
||||||
button.child = new St.Icon({
|
button.child = new St.Icon({
|
||||||
style_class: 'monito-button-icon',
|
style_class: 'monito-button-icon',
|
||||||
|
@ -228,10 +228,7 @@ class GenericServer {
|
|||||||
formatDate ( date )
|
formatDate ( date )
|
||||||
{
|
{
|
||||||
if ( typeof date == 'string' || date instanceof String )
|
if ( typeof date == 'string' || date instanceof String )
|
||||||
{
|
|
||||||
date = Date.parse ( date ) / 1000;
|
date = Date.parse ( date ) / 1000;
|
||||||
log ( date );
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.timeAgo ( new Date ( date * 1000 ) );
|
return this.timeAgo ( new Date ( date * 1000 ) );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user