Skip to content

Commit

Permalink
Theming: Get theme stylesheet using function calls to Main.js (Gnome …
Browse files Browse the repository at this point in the history
…3.26)

Gnome 3.26 GJS/mozj252 doesn't allow us to access
Main._defaultcssstylesheet or Main._cssStylesheet directly.
We need to use the appropriate function calls.
  • Loading branch information
passingthru67 committed Oct 8, 2017
1 parent 4b8cc3f commit 61a5cc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions [email protected]/dockedWorkspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -2084,9 +2084,9 @@ const DockedWorkspaces = new Lang.Class({
let filename = "workspaces-to-dock.css";

// Get new theme stylesheet
let themeStylesheet = Main._defaultCssStylesheet;
if (Main._cssStylesheet != null)
themeStylesheet = Main._cssStylesheet;
let themeStylesheet = Main._getDefaultStylesheet();
if (Main.getThemeStylesheet())
themeStylesheet = Main.getThemeStylesheet();

// Get theme directory
let themeDirectory = themeStylesheet.get_path() ? GLib.path_get_dirname(themeStylesheet.get_path()) : "";
Expand Down
9 changes: 5 additions & 4 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ function loadStylesheet() {
// Get css filename
let filename = "workspaces-to-dock.css";

// Get current theme stylesheet
let themeStylesheet = Main._defaultCssStylesheet;
// Get default stylesheet
let themeStylesheet = Main._getDefaultStylesheet();

if (Main._cssStylesheet != null)
themeStylesheet = Main._cssStylesheet;
// Get current theme stylesheet
if (Main.getThemeStylesheet())
themeStylesheet = Main.getThemeStylesheet();

// Get theme directory
let themeDirectory = themeStylesheet.get_path() ? GLib.path_get_dirname(themeStylesheet.get_path()) : "";
Expand Down

0 comments on commit 61a5cc2

Please sign in to comment.