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

add osd position

parent 745cb39f
......@@ -21,6 +21,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.
### Removed
......
......@@ -32,6 +32,7 @@ This extension allows you to do the following:
| Keyboard Layout Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Looking Glass Size | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Notification Banner Position | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| OSD Position | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :black_circle: |
| OSD Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Panel Arrow Visibility | :black_circle: | :black_circle: | :white_circle: | :white_circle: | :white_circle: |
| Panel Button Padding Size | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
......
......@@ -2753,7 +2753,7 @@ var API = class
*
* @returns {void}
*/
osdSetDefaultPosition()
osdPositionSetDefault()
{
if (this._shellVersion < 42) {
return;
......@@ -2795,7 +2795,7 @@ var API = class
*
* @returns {void}
*/
osdSetPosition(pos)
osdPositionSet(pos)
{
if (this._shellVersion < 42) {
return;
......
......@@ -257,6 +257,10 @@ var Manager = class
this._settings.connect('changed::looking-glass-height', () => {
this._applyLookingGlassSize(false);
});
this._settings.connect('changed::osd-position', () => {
this._applyOSDPosition(false);
});
}
/**
......@@ -317,6 +321,7 @@ var Manager = class
this._applyCalendar(false);
this._applyDashSeparator(false);
this._applyLookingGlassSize(false);
this._applyOSDPosition(false);
}
/**
......@@ -377,6 +382,7 @@ var Manager = class
this._applyCalendar(true);
this._applyDashSeparator(true);
this._applyLookingGlassSize(true);
this._applyOSDPosition(true);
}
/**
......@@ -1295,5 +1301,23 @@ var Manager = class
this._api.lookingGlassSetSize(width, height);
}
}
/**
* apply osd position settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyOSDPosition(forceOriginal)
{
let pos = this._settings.get_int('osd-position');
if (forceOriginal || pos === 0) {
this._api.osdPositionSetDefault();
} else {
this._api.osdPositionSet(pos - 1);
}
}
}
......@@ -680,6 +680,18 @@ var PrefsKeys = class
}
);
this.setKey(
'customize',
'osd-position',
'GtkComboBoxText',
this._shellVersion >= 42,
{
default: 0,
minimal: 0,
superminimal: 0,
}
);
this.setKey(
'customize',
'looking-glass-width',
......
......@@ -355,6 +355,13 @@
<summary>Height Size in percent, 0 means use default size</summary>
<description>Looking Glass Height size</description>
</key>
<key type="i" name="osd-position">
<default>0</default>
<range min="0" max="9"/>
<summary>OSD Position</summary>
<description>OSD Position Status</description>
</key>
</schema>
......
......@@ -103,6 +103,14 @@
</object>
</child>
<child>
<object class="AdwComboRow" id="osd_position_row">
<property name="title" translatable="yes">OSD Position</property>
<property name="subtitle" translatable="yes">OSD position when on screen display shows up on the screen</property>
<property name="model">osd_position_model</property>
</object>
</child>
<child>
<object class="AdwComboRow" id="looking_glass_width_row">
<property name="title" translatable="yes">Looking Glass Width</property>
......@@ -622,6 +630,21 @@
</items>
</object>
<object class="GtkStringList" id="osd_position_model">
<items>
<item translatable="yes">Default</item>
<item translatable="yes">Top Start</item>
<item translatable="yes">Top Center</item>
<item translatable="yes">Top End</item>
<item translatable="yes">Bottom Start</item>
<item translatable="yes">Bottom Center</item>
<item translatable="yes">Bottom End</item>
<item translatable="yes">Center Start</item>
<item translatable="yes">Center</item>
<item translatable="yes">Center End</item>
</items>
</object>
<object class="GtkStringList" id="looking_glass_width_model">
<items>
<item translatable="yes">Default</item>
......
......@@ -1192,6 +1192,95 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="osd_position_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="osd_position_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="osd_position_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="osd_position_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">OSD Position</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">OSD position when on screen display shows up on the screen</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="GtkComboBoxText" id="osd_position_comboboxtext">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
<items>
<item translatable="yes">Default</item>
<item translatable="yes">Top Start</item>
<item translatable="yes">Top Center</item>
<item translatable="yes">Top End</item>
<item translatable="yes">Bottom Start</item>
<item translatable="yes">Bottom Center</item>
<item translatable="yes">Bottom End</item>
<item translatable="yes">Center Start</item>
<item translatable="yes">Center</item>
<item translatable="yes">Center End</item>
</items>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="looking_glass_width_row">
......
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