replace DrawingArea._onStyleChanged() by DrawingArea._updateStyle()
In test of gnome-shell 32 (in VM), 'style-changed' was regularly emitted during drawing, so all 'this.current...' style properties was initialized and it was impossible to select style with 'Ctrl+...' shortcuts. Now style is gathered on drawing mode entered, which is by the way more frugal. Keep watch possible regressions.
This commit is contained in:
parent
e3788ba37f
commit
764d18a090
6
draw.js
6
draw.js
|
|
@ -55,9 +55,6 @@ var DrawingArea = new Lang.Class({
|
|||
_init: function(params, monitor, helper, loadJson) {
|
||||
this.parent({ style_class: 'draw-on-your-screen', name: params && params.name ? params.name : ""});
|
||||
|
||||
// 'style-changed' is emitted when 'this' is added to an actor
|
||||
// ('this' needs to be in the stage to query theme_node)
|
||||
this.connect('style-changed', this._onStyleChanged.bind(this));
|
||||
this.connect('repaint', this._repaint.bind(this));
|
||||
|
||||
this.settings = Convenience.getSettings();
|
||||
|
|
@ -84,7 +81,7 @@ var DrawingArea = new Lang.Class({
|
|||
this.queue_repaint();
|
||||
},
|
||||
|
||||
_onStyleChanged: function() {
|
||||
_updateStyle: function() {
|
||||
try {
|
||||
let themeNode = this.get_theme_node();
|
||||
for (let i = 1; i < 10; i++) {
|
||||
|
|
@ -470,6 +467,7 @@ var DrawingArea = new Lang.Class({
|
|||
this.scrollHandler = this.connect('scroll-event', this._onScroll.bind(this));
|
||||
this.selectShape(Shapes.NONE);
|
||||
this.get_parent().set_background_color(this.hasBackground ? this.activeBackgroundColor : null);
|
||||
this._updateStyle();
|
||||
},
|
||||
|
||||
leaveDrawingMode: function(save) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue