[AppSwitcher] Make the background translucent again
The default AppIcon gray border color isn't very visible against a dark gray background, but a white border looks too bold in the Well. So allow the caller to override the AppIcon border color, so that the Well can use gray-on-black and the AppSwitcher can use white-on-gray. (And then revert the AppSwitcher back to the translucent gray background.) https://bugzilla.gnome.org/show_bug.cgi?id=596337
This commit is contained in:
parent
79d5d3dba0
commit
72dd458c80
@ -12,9 +12,9 @@ const Lightbox = imports.ui.lightbox;
|
|||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
const POPUP_BG_COLOR = new Clutter.Color();
|
const POPUP_BG_COLOR = new Clutter.Color();
|
||||||
POPUP_BG_COLOR.from_pixel(0x000000ff);
|
POPUP_BG_COLOR.from_pixel(0x00000080);
|
||||||
const POPUP_TRANSPARENT = new Clutter.Color();
|
const POPUP_APPICON_BORDER_COLOR = new Clutter.Color();
|
||||||
POPUP_TRANSPARENT.from_pixel(0x00000000);
|
POPUP_APPICON_BORDER_COLOR.from_pixel(0xffffffff);
|
||||||
|
|
||||||
const POPUP_GRID_SPACING = 8;
|
const POPUP_GRID_SPACING = 8;
|
||||||
const POPUP_ICON_SIZE = 48;
|
const POPUP_ICON_SIZE = 48;
|
||||||
@ -66,6 +66,7 @@ AltTabPopup.prototype = {
|
|||||||
|
|
||||||
// FIXME?
|
// FIXME?
|
||||||
appIcon.actor.border = 2;
|
appIcon.actor.border = 2;
|
||||||
|
appIcon.highlight_border_color = POPUP_APPICON_BORDER_COLOR;
|
||||||
|
|
||||||
this._icons.push(appIcon);
|
this._icons.push(appIcon);
|
||||||
this._currentWindows.push(appIcon.windows[0]);
|
this._currentWindows.push(appIcon.windows[0]);
|
||||||
|
@ -28,8 +28,8 @@ const APPICON_CORNER_RADIUS = 4;
|
|||||||
|
|
||||||
const APPICON_MENU_POPUP_TIMEOUT_MS = 600;
|
const APPICON_MENU_POPUP_TIMEOUT_MS = 600;
|
||||||
|
|
||||||
const APPICON_BORDER_COLOR = new Clutter.Color();
|
const APPICON_DEFAULT_BORDER_COLOR = new Clutter.Color();
|
||||||
APPICON_BORDER_COLOR.from_pixel(0x787878ff);
|
APPICON_DEFAULT_BORDER_COLOR.from_pixel(0x787878ff);
|
||||||
const APPICON_MENU_BACKGROUND_COLOR = new Clutter.Color();
|
const APPICON_MENU_BACKGROUND_COLOR = new Clutter.Color();
|
||||||
APPICON_MENU_BACKGROUND_COLOR.from_pixel(0x292929ff);
|
APPICON_MENU_BACKGROUND_COLOR.from_pixel(0x292929ff);
|
||||||
const APPICON_MENU_FONT = 'Sans 14px';
|
const APPICON_MENU_FONT = 'Sans 14px';
|
||||||
@ -64,6 +64,7 @@ AppIcon.prototype = {
|
|||||||
padding: APPICON_PADDING,
|
padding: APPICON_PADDING,
|
||||||
reactive: true });
|
reactive: true });
|
||||||
this.actor._delegate = this;
|
this.actor._delegate = this;
|
||||||
|
this.highlight_border_color = APPICON_DEFAULT_BORDER_COLOR;
|
||||||
|
|
||||||
if (menuType != MenuType.NONE) {
|
if (menuType != MenuType.NONE) {
|
||||||
this.windows = Shell.AppMonitor.get_default().get_windows_for_app(appInfo.get_id());
|
this.windows = Shell.AppMonitor.get_default().get_windows_for_app(appInfo.get_id());
|
||||||
@ -178,7 +179,7 @@ AppIcon.prototype = {
|
|||||||
|
|
||||||
setHighlight: function(highlight) {
|
setHighlight: function(highlight) {
|
||||||
if (highlight) {
|
if (highlight) {
|
||||||
this.actor.border_color = APPICON_BORDER_COLOR;
|
this.actor.border_color = this.highlight_border_color;
|
||||||
} else {
|
} else {
|
||||||
this.actor.border_color = TRANSPARENT_COLOR;
|
this.actor.border_color = TRANSPARENT_COLOR;
|
||||||
}
|
}
|
||||||
@ -273,7 +274,7 @@ AppIconMenu.prototype = {
|
|||||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||||
|
|
||||||
this._windowContainer = new Shell.Menu({ orientation: Big.BoxOrientation.VERTICAL,
|
this._windowContainer = new Shell.Menu({ orientation: Big.BoxOrientation.VERTICAL,
|
||||||
border_color: APPICON_BORDER_COLOR,
|
border_color: source.highlight_border_color,
|
||||||
border: APPICON_MENU_BORDER_WIDTH,
|
border: APPICON_MENU_BORDER_WIDTH,
|
||||||
background_color: APPICON_MENU_BACKGROUND_COLOR,
|
background_color: APPICON_MENU_BACKGROUND_COLOR,
|
||||||
padding: 4,
|
padding: 4,
|
||||||
@ -297,7 +298,7 @@ AppIconMenu.prototype = {
|
|||||||
this._arrow.connect('redraw', Lang.bind(this, function (area, texture) {
|
this._arrow.connect('redraw', Lang.bind(this, function (area, texture) {
|
||||||
Shell.draw_box_pointer(texture,
|
Shell.draw_box_pointer(texture,
|
||||||
this._type == MenuType.ON_RIGHT ? Clutter.Gravity.WEST : Clutter.Gravity.NORTH,
|
this._type == MenuType.ON_RIGHT ? Clutter.Gravity.WEST : Clutter.Gravity.NORTH,
|
||||||
APPICON_BORDER_COLOR,
|
source.highlight_border_color,
|
||||||
APPICON_MENU_BACKGROUND_COLOR);
|
APPICON_MENU_BACKGROUND_COLOR);
|
||||||
}));
|
}));
|
||||||
this.actor.add_actor(this._arrow);
|
this.actor.add_actor(this._arrow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user