Skip to content

Commit

Permalink
window: Port action bar visibility to Adw.Breakpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tchx84 committed Sep 21, 2023
1 parent 888f127 commit ba21d89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/widgets/window.js
Expand Up @@ -42,7 +42,6 @@ const _bindFlags = GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYN
const _bindReadFlags = GObject.BindingFlags.SYNC_CREATE;

const menuResource = '/com/github/tchx84/Flatseal/widgets/menu.ui';
const ACTION_BAR_BREAKPOINT = 540;
const APP_SELECTION_DELAY = 100;


Expand Down Expand Up @@ -409,17 +408,6 @@ var FlatsealWindow = GObject.registerClass({
this._permissions.undo();
}

/* XXX switch to Breakpoints API when available */
vfunc_size_allocate(width, height, baseline) {
const visible = width <= ACTION_BAR_BREAKPOINT;

this._detailsHeaderButton.visible = !visible;
this._resetHeaderButton.visible = !visible;
this._actionBar.visible = visible;

return super.vfunc_size_allocate(width, height, baseline);
}

vfunc_close_request() {
this._settings.saveWindowState(this);
this._shutdown();
Expand Down
3 changes: 3 additions & 0 deletions src/widgets/window.ui
Expand Up @@ -8,6 +8,9 @@
<object class="AdwBreakpoint">
<condition>max-width: 720sp</condition>
<setter object="contentLeaflet" property="collapsed">True</setter>
<setter object="startHeaderBox" property="visible">False</setter>
<setter object="endHeaderBox" property="visible">False</setter>
<setter object="actionBar" property="visible">True</setter>
</object>
</child>
<property name="content">
Expand Down

0 comments on commit ba21d89

Please sign in to comment.