switchMonitor: Only show 'mirror' and 'join' modes when not a laptop
The 'external only' and 'builtin only' options makes no sense if there are only external monitors. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3276 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2056>
This commit is contained in:
parent
7d859fb859
commit
37271ffe70
@ -10,26 +10,44 @@ var APP_ICON_SIZE = 96;
|
|||||||
var SwitchMonitorPopup = GObject.registerClass(
|
var SwitchMonitorPopup = GObject.registerClass(
|
||||||
class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
||||||
_init() {
|
_init() {
|
||||||
let items = [{ icon: 'view-mirror-symbolic',
|
let items = [];
|
||||||
|
|
||||||
|
items.push({
|
||||||
|
icon: 'view-mirror-symbolic',
|
||||||
/* Translators: this is for display mirroring i.e. cloning.
|
/* Translators: this is for display mirroring i.e. cloning.
|
||||||
* Try to keep it under around 15 characters.
|
* Try to keep it under around 15 characters.
|
||||||
*/
|
*/
|
||||||
label: _('Mirror') },
|
label: _('Mirror'),
|
||||||
{ icon: 'video-joined-displays-symbolic',
|
switchMode: Meta.MonitorSwitchConfigType.ALL_MIRROR,
|
||||||
|
});
|
||||||
|
|
||||||
|
items.push({
|
||||||
|
icon: 'video-joined-displays-symbolic',
|
||||||
/* Translators: this is for the desktop spanning displays.
|
/* Translators: this is for the desktop spanning displays.
|
||||||
* Try to keep it under around 15 characters.
|
* Try to keep it under around 15 characters.
|
||||||
*/
|
*/
|
||||||
label: _('Join Displays') },
|
label: _('Join Displays'),
|
||||||
{ icon: 'video-single-display-symbolic',
|
switchMode: Meta.MonitorSwitchConfigType.ALL_LINEAR,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (global.backend.get_monitor_manager().has_builtin_panel) {
|
||||||
|
items.push({
|
||||||
|
icon: 'video-single-display-symbolic',
|
||||||
/* Translators: this is for using only an external display.
|
/* Translators: this is for using only an external display.
|
||||||
* Try to keep it under around 15 characters.
|
* Try to keep it under around 15 characters.
|
||||||
*/
|
*/
|
||||||
label: _('External Only') },
|
label: _('External Only'),
|
||||||
{ icon: 'computer-symbolic',
|
switchMode: Meta.MonitorSwitchConfigType.EXTERNAL,
|
||||||
|
});
|
||||||
|
items.push({
|
||||||
|
icon: 'computer-symbolic',
|
||||||
/* Translators: this is for using only the laptop display.
|
/* Translators: this is for using only the laptop display.
|
||||||
* Try to keep it under around 15 characters.
|
* Try to keep it under around 15 characters.
|
||||||
*/
|
*/
|
||||||
label: _('Built-in Only') }];
|
label: _('Built-in Only'),
|
||||||
|
switchMode: Meta.MonitorSwitchConfigType.BUILTIN,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
super._init(items);
|
super._init(items);
|
||||||
|
|
||||||
@ -65,7 +83,10 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
|||||||
_finish() {
|
_finish() {
|
||||||
super._finish();
|
super._finish();
|
||||||
|
|
||||||
Meta.MonitorManager.get().switch_config(this._selectedIndex);
|
const monitorManager = global.backend.get_monitor_manager();
|
||||||
|
const item = this._items[this._selectedIndex];
|
||||||
|
|
||||||
|
monitorManager.switch_config(item.switchType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user