summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/css/endless-widgets.css4
-rw-r--r--data/css/eos-wikipedia-domain.css9
-rw-r--r--endless/eosflexygrid.c3
-rw-r--r--endless/eostopbar.c7
-rw-r--r--wikipedia/WikipediaWebView.js5
-rw-r--r--wikipedia/widgets/category_button.js26
6 files changed, 36 insertions, 18 deletions
diff --git a/data/css/endless-widgets.css b/data/css/endless-widgets.css
index bfa2027..c820fbc 100644
--- a/data/css/endless-widgets.css
+++ b/data/css/endless-widgets.css
@@ -37,6 +37,10 @@ EosWindow {
from(#464646), to(#1e1e1e));
}
+.top-bar.unmaximized {
+ border-radius: 7px 7px 0px 0px;
+}
+
.top-bar:backdrop {
background-image: -gtk-gradient(linear, center top, center bottom,
from(#282828), to(#1e1e1e));
diff --git a/data/css/eos-wikipedia-domain.css b/data/css/eos-wikipedia-domain.css
index 50e3e71..df6aec6 100644
--- a/data/css/eos-wikipedia-domain.css
+++ b/data/css/eos-wikipedia-domain.css
@@ -82,15 +82,6 @@ Gjs_CategoryButton.clickable:hover {
background-color: alpha(#212121, 0.5);
}
-Gjs_CategoryButton .image {
- opacity: 0.0;
- transition: opacity 150ms ease-in-out;
-}
-
-Gjs_CategoryButton.clickable .image:hover {
- opacity: 1.0;
-}
-
#side_bar_button:hover {
background-color: rgba(0, 0, 0, 0.2);
}
diff --git a/endless/eosflexygrid.c b/endless/eosflexygrid.c
index cb7f285..73b375e 100644
--- a/endless/eosflexygrid.c
+++ b/endless/eosflexygrid.c
@@ -653,8 +653,7 @@ eos_flexy_grid_motion_notify (GtkWidget *widget,
}
EosFlexyGridCell *cell = eos_flexy_grid_get_cell_at_coords (self, relative_x, relative_y);
- if (cell != NULL)
- eos_flexy_grid_update_cell_prelight (self, cell);
+ eos_flexy_grid_update_cell_prelight (self, cell);
return GDK_EVENT_PROPAGATE;
}
diff --git a/endless/eostopbar.c b/endless/eostopbar.c
index 735ba6c..85f4753 100644
--- a/endless/eostopbar.c
+++ b/endless/eostopbar.c
@@ -18,6 +18,7 @@
* The action buttons area contain "minimize", "maximize" and "close" buttons.
*/
#define _EOS_STYLE_CLASS_TOP_BAR "top-bar"
+#define _EOS_STYLE_CLASS_UNMAXIMIZED "unmaximized"
#define _EOS_TOP_BAR_HEIGHT_PX 36
#define _EOS_TOP_BAR_BUTTON_PADDING_PX 4
#define _EOS_TOP_BAR_ICON_SIZE_PX 16
@@ -344,4 +345,10 @@ eos_top_bar_update_window_maximized (EosTopBar *self,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->maximize_icon),
icon_name,
GTK_ICON_SIZE_SMALL_TOOLBAR);
+
+ GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self));
+ if (!is_maximized)
+ gtk_style_context_add_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
+ else
+ gtk_style_context_remove_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
}
diff --git a/wikipedia/WikipediaWebView.js b/wikipedia/WikipediaWebView.js
index 4fd6ee6..771a38c 100644
--- a/wikipedia/WikipediaWebView.js
+++ b/wikipedia/WikipediaWebView.js
@@ -137,13 +137,14 @@ const WikipediaWebView = new Lang.Class({
let suffix = parts[parts.length - 1];
let id = decodeURI(suffix);
this.loadArticleById(id);
- return true;
+ decision.ignore();
+ return true; // handled
} else if (GLib.uri_parse_scheme(uri).startsWith('browser-')) {
// Open everything that starts with 'browser-' in the system
// browser
let realURI = uri.slice('browser-'.length);
- printerr('Showing', realURI);
Gtk.show_uri(null, realURI, Gdk.CURRENT_TIME);
+ decision.ignore();
return true; // handled
}
}
diff --git a/wikipedia/widgets/category_button.js b/wikipedia/widgets/category_button.js
index 08ce2ed..cafa7a6 100644
--- a/wikipedia/widgets/category_button.js
+++ b/wikipedia/widgets/category_button.js
@@ -96,6 +96,26 @@ const CategoryButton = new Lang.Class({
this._inner_grid.add(this._arrow);
this.add(this._inner_grid);
this.show_all();
+
+ // For some reason, on the NUC, setting opacity in CSS for this button does not work.
+ // So we have to set it in Gtk code. Also, we have to set the opacity
+ // to zero upfront. I am putting that here instead of in the initialisation
+ // of the arrow since it is part of this NUC-specific hack
+ this._arrow.connect('state-flags-changed', Lang.bind(this, this._update_appearance));
+ this._arrow.set_opacity(0)
+ },
+
+ _update_appearance: function(widget) {
+ // If button is hovered over and/or pressed, then show the arrow icon
+ if ((widget.get_state_flags() & Gtk.StateFlags.ACTIVE ||
+ widget.get_state_flags() & Gtk.StateFlags.PRELIGHT) &&
+ this._clickable_category) {
+ this._arrow.set_opacity(1);
+ return false;
+ }
+ // If no hover or press, then hide the arrow icon
+ this._arrow.set_opacity(0);
+ return false;
},
get image_uri() {
@@ -122,11 +142,7 @@ const CategoryButton = new Lang.Class({
set clickable_category(value) {
this._clickable_category = value;
- if(this._clickable_category) {
- this.get_style_context().add_class(EndlessWikipedia.STYLE_CLASS_CATEGORY_CLICKABLE);
- } else {
- this.get_style_context().remove_class(EndlessWikipedia.STYLE_CLASS_CATEGORY_CLICKABLE);
- }
+ this._update_appearance(this._arrow);
},
get is_main_category() {