Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Julia Radzhabova 2021-12-14 14:34:52 +03:00
commit 4bade4d583
4 changed files with 34 additions and 2 deletions

View file

@ -60,6 +60,7 @@ define([
this._state = {}; this._state = {};
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('contenttheme:dark', this.onContentThemeChangedToDark.bind(this)); Common.NotificationCenter.on('contenttheme:dark', this.onContentThemeChangedToDark.bind(this));
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
}, },
setApi: function (api) { setApi: function (api) {
@ -203,5 +204,15 @@ define([
this.view && this.view.btnDarkDocument.toggle(isdark, true); this.view && this.view.btnDarkDocument.toggle(isdark, true);
}, },
onThemeChanged: function () {
if (this.view) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
this.view.btnInterfaceTheme.menu.clearAll();
menu_item.setChecked(true, true);
this.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme());
}
},
}, DE.Controllers.ViewTab || {})); }, DE.Controllers.ViewTab || {}));
}); });

View file

@ -49,7 +49,7 @@ define([
return { return {
options: {}, options: {},
setEvents() { setEvents: function () {
var me = this; var me = this;
me.btnNavigation.on('click', function (btn, e) { me.btnNavigation.on('click', function (btn, e) {
me.fireEvent('viewtab:navigation', [btn.pressed]); me.fireEvent('viewtab:navigation', [btn.pressed]);

View file

@ -62,6 +62,7 @@ define([
zoom_percent: undefined zoom_percent: undefined
}; };
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
}, },
setApi: function (api) { setApi: function (api) {
@ -195,7 +196,16 @@ define([
Common.localStorage.setBool('pe-hidden-notes', !checked); Common.localStorage.setBool('pe-hidden-notes', !checked);
this.view.fireEvent('notes:hide', [!checked]); this.view.fireEvent('notes:hide', [!checked]);
Common.NotificationCenter.trigger('edit:complete', this.view); Common.NotificationCenter.trigger('edit:complete', this.view);
} },
onThemeChanged: function () {
if (this.view) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
this.view.btnInterfaceTheme.menu.clearAll();
menu_item.setChecked(true, true);
}
},
}, PE.Controllers.ViewTab || {})); }, PE.Controllers.ViewTab || {}));
}); });

View file

@ -59,6 +59,7 @@ define([
}, },
onLaunch: function () { onLaunch: function () {
this._state = {}; this._state = {};
Common.NotificationCenter.on('uitheme:changed', this.onThemeChanged.bind(this));
}, },
setApi: function (api) { setApi: function (api) {
@ -246,6 +247,16 @@ define([
onApiZoomChange: function(zf, type){ onApiZoomChange: function(zf, type){
var value = Math.floor((zf + .005) * 100); var value = Math.floor((zf + .005) * 100);
this.view.cmbZoom.setValue(value, value + '%'); this.view.cmbZoom.setValue(value, value + '%');
},
onThemeChanged: function () {
if (this.view) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
this.view.btnInterfaceTheme.menu.clearAll();
menu_item.setChecked(true, true);
}
} }
}, SSE.Controllers.ViewTab || {})); }, SSE.Controllers.ViewTab || {}));
}); });