mirror of
https://github.com/elementary/gala.git
synced 2024-11-25 03:06:14 +01:00
parent
1f6889ffbd
commit
92bc6b8a1e
@ -218,7 +218,12 @@ namespace Gala {
|
||||
|
||||
maximize.visible = Gala.WindowFlags.CAN_MAXIMIZE in flags;
|
||||
if (maximize.visible) {
|
||||
var maximize_label = Gala.WindowFlags.IS_MAXIMIZED in flags ? _("Unmaximize") : _("Maximize");
|
||||
unowned string maximize_label;
|
||||
if (Gala.WindowFlags.IS_MAXIMIZED in flags) {
|
||||
maximize_label = (Gala.WindowFlags.IS_TILED in flags) ? _("Untile") : _("Unmaximize");
|
||||
} else {
|
||||
maximize_label = _("Maximize");
|
||||
}
|
||||
|
||||
maximize.get_child ().destroy ();
|
||||
maximize.add (
|
||||
|
@ -46,7 +46,8 @@ namespace Gala {
|
||||
ALLOWS_RESIZE,
|
||||
ALWAYS_ON_TOP,
|
||||
ON_ALL_WORKSPACES,
|
||||
CAN_CLOSE
|
||||
CAN_CLOSE,
|
||||
IS_TILED
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -770,7 +770,8 @@ namespace Gala {
|
||||
if (current == null || current.window_type != Meta.WindowType.NORMAL)
|
||||
break;
|
||||
|
||||
if (current.get_maximized () == (Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL))
|
||||
var maximize_flags = current.get_maximized ();
|
||||
if (Meta.MaximizeFlags.VERTICAL in maximize_flags || Meta.MaximizeFlags.HORIZONTAL in maximize_flags)
|
||||
current.unmaximize (Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL);
|
||||
else
|
||||
current.maximize (Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL);
|
||||
@ -909,9 +910,15 @@ namespace Gala {
|
||||
if (window.can_maximize ())
|
||||
flags |= WindowFlags.CAN_MAXIMIZE;
|
||||
|
||||
if (window.get_maximized () > 0)
|
||||
var maximize_flags = window.get_maximized ();
|
||||
if (maximize_flags > 0) {
|
||||
flags |= WindowFlags.IS_MAXIMIZED;
|
||||
|
||||
if (Meta.MaximizeFlags.VERTICAL in maximize_flags && !(Meta.MaximizeFlags.HORIZONTAL in maximize_flags)) {
|
||||
flags |= WindowFlags.IS_TILED;
|
||||
}
|
||||
}
|
||||
|
||||
if (window.allows_move ())
|
||||
flags |= WindowFlags.ALLOWS_MOVE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user