Skip to content

Commit

Permalink
Merge pull request #344 from Leleat/active-window-hint-v2
Browse files Browse the repository at this point in the history
Active window hint v2
  • Loading branch information
Leleat authored Aug 11, 2024
2 parents e0cf30c + 2dc8d58 commit 169656a
Show file tree
Hide file tree
Showing 8 changed files with 947 additions and 401 deletions.
8 changes: 4 additions & 4 deletions tiling-assistant@leleat-on-github/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import MoveHandler from './src/extension/moveHandler.js';
import ResizeHandler from './src/extension/resizeHandler.js';
import KeybindingHandler from './src/extension/keybindingHandler.js';
import LayoutsManager from './src/extension/layoutsManager.js';
import ActiveWindowHint from './src/extension/activeWindowHint.js';
import AltTabOverride from './src/extension/altTab.js';
import FocusHintManager from './src/extension/focusHint.js';
import { Rect } from './src/extension/utility.js';

/**
Expand Down Expand Up @@ -160,7 +160,7 @@ export default class TilingAssistantExtension extends Extension {
this._resizeHandler = new ResizeHandler();
this._keybindingHandler = new KeybindingHandler();
this._layoutsManager = new LayoutsManager();
this._activeWindowHintHandler = new ActiveWindowHint();
this._focusHintManager = new FocusHintManager();
this._altTabOverride = new AltTabOverride();

// Disable native tiling.
Expand Down Expand Up @@ -239,8 +239,8 @@ export default class TilingAssistantExtension extends Extension {
this._keybindingHandler = null;
this._layoutsManager.destroy();
this._layoutsManager = null;
this._activeWindowHintHandler.destroy();
this._activeWindowHintHandler = null;
this._focusHintManager.destroy();
this._focusHintManager = null;

this._altTabOverride.destroy();
this._altTabOverride = null;
Expand Down
14 changes: 7 additions & 7 deletions tiling-assistant@leleat-on-github/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ export default class Prefs extends ExtensionPreferences {
'screen-left-gap',
'screen-right-gap',
'screen-bottom-gap',
'active-window-hint-border-size',
'active-window-hint-inner-border-size',
'focus-hint-outline-size',
'toggle-maximize-tophalf-timer',
'vertical-preview-area',
'horizontal-preview-area'
Expand Down Expand Up @@ -135,7 +134,7 @@ export default class Prefs extends ExtensionPreferences {
*/
_bindColorButtons(settings, builder) {
const switches = [
'active-window-hint-color'
'focus-hint-color'
];

switches.forEach(key => {
Expand Down Expand Up @@ -170,11 +169,12 @@ export default class Prefs extends ExtensionPreferences {
]
},
{
key: 'active-window-hint',
key: 'focus-hint',
rowNames: [
'active_window_hint_disabled_row',
'active_window_hint_minimal_row',
'active_window_hint_always_row'
'disabled_focus_hint_row',
'animated_outline_focus_hint_row',
'animated_upscale_focus_hint_row',
'static_outline_focus_hint_row'
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
<!-- 0: Disabled, 1: Focus, 2: Tiling State, 3: Tiling State (Windows), 4: Favorite Layout -->
<default>0</default>
</key>
<key name="active-window-hint" type="i">
<!-- 0: Disabled, 1: Minimal, 2: Always -->
<default>1</default>
<key name="focus-hint" type="i">
<default>0</default>
</key>
<key name="active-window-hint-color" type="s">
<key name="focus-hint-color" type="s">
<default>''</default>
</key>
<key name="active-window-hint-border-size" type="i">
<default>5</default>
<key name="focus-hint-outline-border-radius" type="i">
<default>8</default>
</key>
<key name="active-window-hint-inner-border-size" type="i">
<default>0</default>
<key name="focus-hint-outline-size" type="i">
<default>8</default>
</key>
<key name="window-gap" type="i">
<default>0</default>
Expand Down
7 changes: 7 additions & 0 deletions tiling-assistant@leleat-on-github/src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ export class DynamicKeybindings {
static FAVORITE_LAYOUT = 4;
}

export const FocusHint = Object.freeze({
DISABLED: 0,
ANIMATED_OUTLINE: 1,
ANIMATED_UPSCALE: 2,
STATIC_OUTLINE: 3
});

export class MoveModes {
// Order comes from prefs
static EDGE_TILING = 0;
Expand Down
2 changes: 2 additions & 0 deletions tiling-assistant@leleat-on-github/src/dependencies/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ export {
gettext as _
} from 'resource:///org/gnome/shell/extensions/extension.js';

export * as AppFavorites from 'resource:///org/gnome/shell/ui/appFavorites.js';
export * as AltTab from 'resource:///org/gnome/shell/ui/altTab.js';
export * as Main from 'resource:///org/gnome/shell/ui/main.js';
export * as OsdWindow from 'resource:///org/gnome/shell/ui/osdWindow.js';
export * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
export * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
export * as SwitcherPopup from 'resource:///org/gnome/shell/ui/switcherPopup.js';
Expand Down
Loading

0 comments on commit 169656a

Please sign in to comment.