Replace window realm frame decorations with nicer label decorations
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
|
||||
import * as PopupMenu from '../popupMenu.js';
|
||||
import * as Main from '../main.js';
|
||||
|
||||
function _windowAppId(window) {
|
||||
const tracker = Shell.WindowTracker.get_default();
|
||||
@ -79,22 +79,20 @@ function windowContextRealmName(window) {
|
||||
}
|
||||
}
|
||||
|
||||
export function enableFrameItem(window) {
|
||||
const realms = Shell.Realms.get_default();
|
||||
const frames = realms.window_frames();
|
||||
if (!frames.has_frame(window)) {
|
||||
export function enableLabelItem(window) {
|
||||
const labelManager = Main.realmManager.labelManager;
|
||||
|
||||
if (!labelManager.windowNeedsLabel(window)) {
|
||||
return null;
|
||||
}
|
||||
let enabled = frames.is_frame_enabled(window);
|
||||
let item = new PopupMenu.PopupMenuItem("Display colored window frame");
|
||||
let enabled = labelManager.getWindowLabelEnabled(window);
|
||||
let item = new PopupMenu.PopupMenuItem("Display realm label on window");
|
||||
if (enabled) {
|
||||
item.setOrnament(PopupMenu.Ornament.CHECK);
|
||||
}
|
||||
|
||||
item.connect('activate', () => {
|
||||
let realms = Shell.Realms.get_default();
|
||||
const frames = realms.window_frames();
|
||||
frames.set_frame_enabled(window, !enabled);
|
||||
Main.realmManager.labelManager.setWindowLabelEnabled(window, !enabled);
|
||||
});
|
||||
|
||||
return item;
|
||||
|
Reference in New Issue
Block a user