Commit a7f36358 authored by Javad Rahmatzadeh's avatar Javad Rahmatzadeh
Browse files

add window menu take screenshot visibility

Fixes #116
parent bf06bcba
......@@ -22,6 +22,7 @@ We go to the next version after each release on [GNOME Shell Extensions website]
- Dash separator visibility.
- Looking glass size by [@AdvendraDeswanta](https://gitlab.gnome.org/AdvendraDeswanta).
- OSD position.
- Take screenshot button in window menu visibility.
### Removed
......
......@@ -49,6 +49,7 @@ This extension allows you to do the following:
| Search Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Startup Status | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: |
| System Menu (Aggregate Menu) Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Take Screenshot Button in Window Menu Visibility | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :black_circle: |
| Weather Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Window Demands Attention Focus | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Window Picker Caption Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
......
......@@ -261,6 +261,10 @@ var Manager = class
this._settings.connect('changed::osd-position', () => {
this._applyOSDPosition(false);
});
this._settings.connect('changed::window-menu-take-screenshot-button', () => {
this._applyWindowMenuTakeScreenshotButton(false);
});
}
/**
......@@ -322,6 +326,7 @@ var Manager = class
this._applyDashSeparator(false);
this._applyLookingGlassSize(false);
this._applyOSDPosition(false);
this._applyWindowMenuTakeScreenshotButton(false);
}
/**
......@@ -383,6 +388,7 @@ var Manager = class
this._applyDashSeparator(true);
this._applyLookingGlassSize(true);
this._applyOSDPosition(true);
this._applyWindowMenuTakeScreenshotButton(true);
}
/**
......@@ -1319,5 +1325,23 @@ var Manager = class
this._api.osdPositionSet(pos - 1);
}
}
/**
* apply window menu take screenshot button settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyWindowMenuTakeScreenshotButton(forceOriginal)
{
let status = this._settings.get_boolean('window-menu-take-screenshot-button');
if (forceOriginal || status) {
this._api.screenshotInWindowMenuShow();
} else {
this._api.screenshotInWindowMenuHide();
}
}
}
......@@ -327,6 +327,18 @@ var PrefsKeys = class
}
);
this.setKey(
'visibility',
'window-menu-take-screenshot-button',
'GtkSwitch',
this._shellVersion >= 42,
{
default: true,
minimal: true,
superminimal: true,
}
);
this.setKey(
'icons',
'app-menu-icon',
......
......@@ -363,6 +363,12 @@
<description>OSD Position Status</description>
</key>
<key type="b" name="window-menu-take-screenshot-button">
<default>true</default>
<summary>Window Menu Take Screenshot Button Visibility</summary>
<description>Window Menu Take Screenshot Button Visibility Status</description>
</key>
</schema>
</schemalist>
......@@ -320,6 +320,19 @@
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="window_menu_take_screenshot_button_row">
<property name="title" translatable="yes">Take Screenshot button in Window Menu</property>
<property name="subtitle" translatable="yes">Take screenshot button in title bar right click menu</property>
<property name="activatable-widget">window_menu_take_screenshot_button_switch</property>
<child>
<object class="GtkSwitch" id="window_menu_take_screenshot_button_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
......
......@@ -1836,6 +1836,83 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="window_menu_take_screenshot_button_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="window_menu_take_screenshot_button_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="window_menu_take_screenshot_button_box2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">32</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="window_menu_take_screenshot_button_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Take Screenshot button in Window Menu</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Take screenshot button in title bar right click menu</property>
<property name="xalign">0</property>
<property name="wrap">True</property>
<property name="width-chars">0</property>
<property name="margin-top">12</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSwitch" id="window_menu_take_screenshot_button_switch">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment