mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-17 15:21:56 +00:00
fix the changing of the theme on the fly
This commit is contained in:
parent
7f4b433e49
commit
fd004a1d07
2 changed files with 23 additions and 5 deletions
|
@ -57,7 +57,7 @@ Deluge.UI = {
|
||||||
|
|
||||||
window.addEvent('resize', this.bound.resized);
|
window.addEvent('resize', this.bound.resized);
|
||||||
Deluge.UI.update();
|
Deluge.UI.update();
|
||||||
$('overlay').destroy();
|
this.overlay = $('overlay').dispose();
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize_grid: function() {
|
initialize_grid: function() {
|
||||||
|
@ -146,11 +146,20 @@ Deluge.UI = {
|
||||||
},
|
},
|
||||||
|
|
||||||
setTheme: function(name, fn) {
|
setTheme: function(name, fn) {
|
||||||
|
if (this.overlay) {
|
||||||
|
this.overlay.inject(document.body);
|
||||||
|
}
|
||||||
this.theme = name;
|
this.theme = name;
|
||||||
if (this.themecss) this.themecss.destroy();
|
if (this.themecss) this.themecss.destroy();
|
||||||
this.themecss = new Asset.css('/template/static/themes/' + name + '/style.css');
|
this.themecss = new Asset.css('/template/static/themes/' + name + '/style.css');
|
||||||
Cookie.write('theme', name);
|
Cookie.write('theme', name);
|
||||||
if (this.vbox) this.vbox.refresh();
|
if (this.overlay) {
|
||||||
|
var temp = function() {
|
||||||
|
this.vbox.refresh();
|
||||||
|
this.vbox.calculatePositions();
|
||||||
|
this.overlay.dispose();
|
||||||
|
}.bind(this).delay(100);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
run: function() {
|
run: function() {
|
||||||
|
|
|
@ -366,10 +366,11 @@ Widgets.Base = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
|
this.element.removeProperty('style');
|
||||||
this.width = (this.options.width) ? this.options.width : this.element.getStyle('width').toInt()
|
this.width = (this.options.width) ? this.options.width : this.element.getStyle('width').toInt()
|
||||||
this.height = (this.options.height) ? this.options.height : this.element.getStyle('height').toInt()
|
this.height = (this.options.height) ? this.options.height : this.element.getStyle('height').toInt()
|
||||||
this.getSizeModifiers();
|
this.getSizeModifiers();
|
||||||
if (this.calculatePositions) this.calculatePositions();
|
if (this.refreshChildren) this.refreshChildren();
|
||||||
},
|
},
|
||||||
|
|
||||||
expand: function() {
|
expand: function() {
|
||||||
|
@ -959,8 +960,8 @@ Widgets.VBox = new Class({
|
||||||
box = $W(box)
|
box = $W(box)
|
||||||
box.boxinfo = (options) ? options : {fixed: false};
|
box.boxinfo = (options) ? options : {fixed: false};
|
||||||
this.boxes.include(box);
|
this.boxes.include(box);
|
||||||
this.element.grab(box)
|
this.element.grab(box);
|
||||||
box.element.setStyle('position', 'absolute')
|
box.element.setStyle('position', 'absolute');
|
||||||
},
|
},
|
||||||
|
|
||||||
calculatePositions: function() {
|
calculatePositions: function() {
|
||||||
|
@ -990,6 +991,7 @@ Widgets.VBox = new Class({
|
||||||
boxinfo.width = size.x - box.element.modifiers.x
|
boxinfo.width = size.x - box.element.modifiers.x
|
||||||
boxinfo.top = position.y
|
boxinfo.top = position.y
|
||||||
boxinfo.left = position.x
|
boxinfo.left = position.x
|
||||||
|
|
||||||
box.sets({
|
box.sets({
|
||||||
height: boxinfo.height,
|
height: boxinfo.height,
|
||||||
width: boxinfo.width,
|
width: boxinfo.width,
|
||||||
|
@ -998,6 +1000,13 @@ Widgets.VBox = new Class({
|
||||||
})
|
})
|
||||||
position.y += box.height + box.element.modifiers.y
|
position.y += box.height + box.element.modifiers.y
|
||||||
}, this)
|
}, this)
|
||||||
|
},
|
||||||
|
|
||||||
|
refreshChildren: function() {
|
||||||
|
this.boxes.each(function(box) {
|
||||||
|
box.refresh();
|
||||||
|
box.element.setStyle('position', 'absolute');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue