Skip to content
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

Closed
wants to merge 6 commits into from
Closed

Fixed hide-corners bug #140

wants to merge 6 commits into from

Conversation

ajbucci
Copy link
Contributor

@ajbucci ajbucci commented Apr 12, 2021

Hey, this is my first pull request so apologies if I haven't done this quite right! This should fix the issue "Panel corners black after toggling overview"

Fixes #139

@ajbucci
Copy link
Contributor Author

ajbucci commented Apr 12, 2021

This is only a partial fix. The black corners will return if the background custom opacities are adjusted, though re-enabling the extension fixes it until the opacities are adjusted again. It may be due to how set_corner_color is working in theming.js?

@ewlsh Should be fixed with 58284e4

@Arcitec
Copy link

Arcitec commented Apr 26, 2021

@ewlsh @ajbucci Thanks for trying to solve this issue. It looks like the solution here might be over-engineered?

I posted a comment on the issue ticket, which mentions how to solve this problem with 1 line of CSS:

#139 (comment)

[email protected]/stylesheet.css Outdated Show resolved Hide resolved
@@ -150,6 +150,31 @@ function has_icon_shadow() {
function remove_text_shadow() {
Panel.remove_style_class_name('dpt-panel-text-shadow');
}
/**
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove register_hide_corners - you don't need a dynamic stylesheet for a static style.

@@ -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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert.

@@ -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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert.

@@ -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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert.

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. */
let hide_corners = Theming.register_hide_corners();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let hide_corners = Theming.register_hide_corners();

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. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Register hide corners. */

let hide_corners = Theming.register_hide_corners();

if (Settings.get_hide_corners()) {
if (hide_corners !== null) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove conditional.

@@ -20,3 +20,6 @@
background-image: none;
}

/* Prevents overlapping of corners + top bar when using transparency */
.panel-corner {
-panel-corner-border-width: 0px;}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-panel-corner-border-width: 0px;}
-panel-corner-border-width: 0px;
}

@@ -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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@ewlsh
Copy link
Owner

ewlsh commented Apr 30, 2021

@ajbucci I reviewed this and listed the necessary changes, I'll apply them myself and commit this weekend unless you'd like to.

@ajbucci
Copy link
Contributor Author

ajbucci commented May 1, 2021

@ewlsh Thanks for taking the time to review the changes! I'm a bit shot at the moment as my wife and I just had our first child this past week and are still adjusting. Go ahead and apply your changes/suggestions this weekend. Thanks again!

@ewlsh
Copy link
Owner

ewlsh commented Nov 11, 2021

Changes were manually applied, thank you 👋

@ewlsh ewlsh closed this Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panel corners black after toggling overview
3 participants