-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed hide-corners bug #140
Changes from 2 commits
753c681
58284e4
670c4c8
e84c46c
2ac23c1
2d52f72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -106,14 +106,25 @@ function modify_panel() { | |||
/* Register text color styling. */ | ||||
let [text, icon, arrow] = Theming.register_text_color(Settings.get_text_color()); // eslint-disable-line no-unused-vars | ||||
let [maximized_text, maximized_icon, maximized_arrow] = Theming.register_text_color(Settings.get_maximized_text_color(), 'maximized'); // eslint-disable-line no-unused-vars | ||||
|
||||
if (Settings.get_enable_text_color()) { | ||||
if (text !== null) { | ||||
Theming.set_text_color(); | ||||
} else { | ||||
log('[Dynamic Panel Transparency] Failed to enabled text coloring.'); | ||||
} | ||||
} | ||||
|
||||
/* Register hide corners. */ | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
let hide_corners = Theming.register_hide_corners(); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
||||
if (Settings.get_hide_corners()) { | ||||
if (hide_corners !== null) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove conditional. |
||||
Theming.add_hide_corners(); | ||||
} else { | ||||
log('[Dynamic Panel Transparency] Failed to enable hide corners.'); | ||||
} | ||||
} | ||||
} | ||||
|
||||
function unmodify_panel() { | ||||
|
@@ -154,7 +165,11 @@ function initialize_settings() { | |||
name: 'hide_corners', | ||||
type: 'b', | ||||
handler: (function() { | ||||
Transitions.update_corner_alpha(); | ||||
if (Settings.get_hide_corners()) { | ||||
Theming.add_hide_corners(); | ||||
} else { | ||||
Theming.remove_hide_corners(); | ||||
} | ||||
}.bind(this)) | ||||
}); | ||||
Settings.add({ | ||||
|
@@ -206,7 +221,7 @@ function initialize_settings() { | |||
|
||||
for (let i = Theming.stylesheets.length - 1; i >= 0; i--) { | ||||
let stylesheet = Theming.stylesheets[i]; | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel-') !== -1) { | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel-') !== -1 && stylesheet.indexOf('panel-hide-corners') == -1) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert. |
||||
theme.unload_stylesheet(Util.get_file(stylesheet)); | ||||
Util.remove_file(stylesheet); | ||||
Theming.stylesheets.splice(i, 1); | ||||
|
@@ -247,7 +262,7 @@ function initialize_settings() { | |||
|
||||
for (let i = Theming.stylesheets.length - 1; i >= 0; i--) { | ||||
let stylesheet = Theming.stylesheets[i]; | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel-') !== -1) { | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel-') !== -1 && stylesheet.indexOf('panel-hide-corners') == -1) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert. |
||||
theme.unload_stylesheet(Util.get_file(stylesheet)); | ||||
Util.remove_file(stylesheet); | ||||
Theming.stylesheets.splice(i, 1); | ||||
|
@@ -285,7 +300,7 @@ function initialize_settings() { | |||
|
||||
for (let i = Theming.stylesheets.length - 1; i >= 0; i--) { | ||||
let stylesheet = Theming.stylesheets[i]; | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel.dpt.css') !== -1) { | ||||
if (stylesheet.indexOf('background') !== -1 && stylesheet.indexOf('panel.dpt.css') !== -1 && stylesheet.indexOf('panel-hide-corners') == -1) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert. |
||||
theme.unload_stylesheet(Util.get_file(stylesheet)); | ||||
Util.remove_file(stylesheet); | ||||
Theming.stylesheets.splice(i, 1); | ||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,3 +20,6 @@ | |||||||||
background-image: none; | ||||||||||
} | ||||||||||
|
||||||||||
/* Prevents overlapping of corners + top bar when using transparency */ | ||||||||||
.panel-corner { | ||||||||||
ajbucci marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
-panel-corner-border-width: 0px;} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* exported init, cleanup, remove_maximized_background_color, remove_unmaximized_background_color, set_maximized_background_color, set_unmaximized_background_color, remove_background_color, register_text_shadow, add_text_shadow, register_icon_shadow, add_icon_shadow, has_text_shadow, has_icon_shadow, remove_text_shadow, remove_icon_shadow, register_text_color, set_text_color, remove_text_color, set_panel_color, set_corner_color, clear_corner_color, get_background_image_color, get_background_color, get_maximized_opacity, get_unmaximized_opacity, strip_panel_styling, reapply_panel_styling, strip_panel_background_image, reapply_panel_background_image, strip_panel_background, reapply_panel_background, set_background_alpha */ | ||
/* exported init, cleanup, register_hide_corners, add_hide_corners, remove_hide_corners, remove_maximized_background_color, remove_unmaximized_background_color, set_maximized_background_color, set_unmaximized_background_color, remove_background_color, register_text_shadow, add_text_shadow, register_icon_shadow, add_icon_shadow, has_text_shadow, has_icon_shadow, remove_text_shadow, remove_icon_shadow, register_text_color, set_text_color, remove_text_color, set_panel_color, set_corner_color, clear_corner_color, get_background_image_color, get_background_color, get_maximized_opacity, get_unmaximized_opacity, strip_panel_styling, reapply_panel_styling, strip_panel_background_image, reapply_panel_background_image, strip_panel_background, reapply_panel_background, set_background_alpha */ | ||
|
||
const St = imports.gi.St; | ||
|
||
|
@@ -150,6 +150,31 @@ function has_icon_shadow() { | |
function remove_text_shadow() { | ||
Panel.remove_style_class_name('dpt-panel-text-shadow'); | ||
} | ||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
* Registers a hide corners stylesheet. | ||
* | ||
*/ | ||
function register_hide_corners() { | ||
let stylesheet = apply_stylesheet_css('.dpt-panel-hide-corners .panel-corner { -panel-corner-radius: 0px; }', 'background/panel-hide-corners'); | ||
|
||
register_style('dpt-panel-hide-corners'); | ||
|
||
return stylesheet; | ||
} | ||
/** | ||
* Adds the currently registered hide corners stylesheet to the corners of the panel. | ||
* | ||
*/ | ||
function add_hide_corners() { | ||
Panel.add_style_class_name('dpt-panel-hide-corners'); | ||
} | ||
/** | ||
* Unhides corners; deregistering the stylesheet and removing the css. | ||
* | ||
*/ | ||
function remove_hide_corners() { | ||
Panel.remove_style_class_name('dpt-panel-hide-corners'); | ||
} | ||
|
||
/** | ||
* Removes any icon shadowing; deregistering the stylesheet and removing the css. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.