fthx / babar

Task bar. GNOME Shell extension
GNU General Public License v3.0
41 stars 14 forks source link

Borders wrapping task, and activities button, too narrow on GNOME 40 #19

Closed frandieguez closed 3 years ago

frandieguez commented 3 years ago

Hi,

sometimes in GNOME 40 the box that encloses groups, like tasks or the activities button, is too narrow as you can see in the next image. image

This is weird because sometimes there is enough space and others dont. This issue can be seen more times in the activities button.

Regards.

fthx commented 3 years ago

Ok, the Activities "bug" make me find the culprit: reducing padding option. Because if Activities is checked in BaBar prefs, I don't hack in any way this GS button, except through CSS... We have to find a way to reduce between-elements padding without modifying inner padding. Don't know if it's possible. Turning off padding reduction does solve the bug but is not what we want, I think.

fthx commented 3 years ago

Ok, I'm about to solve this.

fthx commented 3 years ago

Could you try this CSS? I tried some hacks but did not find a padding that is good for all elements (Activities, Places, Tasks...).

.leftbox-reduced-padding .panel-button {
  -natural-hpadding: 6px;
  -minimum-hpadding: 6px;
}

.workspace-active-squared {
  margin-left: 10px;
  margin-right: 10px;
  background-color: rgba(204, 204, 204, 1);
  color: rgba(0, 0, 0, 1);
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 2px;
}

.workspace-inactive-squared {
  margin-left: 10px;
  margin-right: 10px;
  background-color: rgba(127, 127, 127, 1);
  color: rgba(0, 0, 0, 1);
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 2px;
}

.workspace-active-rounded {
  margin-left: 10px;
  margin-right: 10px;
  background-color: rgba(204, 204, 204, 1);
  color: rgba(0, 0, 0, 1);
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 10px;
}

.workspace-inactive-rounded {
  margin-left: 10px;
  margin-right: 10px;
  background-color: rgba(127, 127, 127, 1);
  color: rgba(0, 0, 0, 1);
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 10px;
}

.favorite {
  margin-left: 0px;
  margin-right: 0px;
  padding: 0px;
  spacing: 16px;
}

.window-box {
  margin-left: 4px;
  margin-right: 4px;
  border-radius: 0px;
  padding: 0px;
}

.window-focused {
  border-top: 2px solid rgba(204, 204, 204, 1);
  border-right: 0px hidden;
  border-bottom: 2px hidden;
  border-left: 0px hidden;
}

.window-unfocused {
  border-top: 2px solid rgba(255, 255, 255, 0);
  border-right: 0px hidden;
  border-bottom: 2px hidden;
  border-left: 0px hidden;
}

.window-hidden {
  border-top: 2px solid rgba(255, 255, 255, 0);
  border-right: 0px hidden;
  border-bottom: 2px hidden;
  border-left: 0px hidden;
}

.window-tooltip {
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 4px;
  padding-bottom: 4px;
  background-color: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 2px;
}
frandieguez commented 3 years ago

Seems to fix the issue for the task and favorites group, but not for the activities button image

fthx commented 3 years ago

That's crazy, I do not have your Activities issue.

image

fthx commented 3 years ago

Ok I realized that I did a slight modification in extension.js: include:

// Activities button
        this._show_activities(DISPLAY_ACTIVITIES);

at the end of enable function, instead of the actual place.

fthx commented 3 years ago

(Note that is not convenient for me to handle changes because I hack extension in my VM but my main code is in my Ubuntu...)

frandieguez commented 3 years ago

Seems to improve a little bit but not quite what it should be

This is with babar image

and this is stock image

fthx commented 3 years ago

As far as I understand the new frame in GS 40, its size is based on elements padding. I don't really know why. So if we want to reduce padding, the frame will be reduced. You can disable the reduce padding option... Or maybe there is another CSS property that does the magic.

fthx commented 3 years ago

Maybe give an option to change Activities label to an icon, for users like you that don't use the workspaces buttons? Maybe simply change appgrid button behavior regarding workspaces buttons option?

fthx commented 3 years ago

Ok I consider this one solved. https://github.com/fthx/babar/commit/fac033c865171ccd5ff1af7e2a783997b638c2f7

I did not succeed to do better for Activities. But now the top frame for active task is included in box background in GS 40, it's much better.

The downside is that it reduces the optimal task icon size in GS < 40. I changed the prefs item accordingly (default to 18, but tell user that 20 is better for GS 40). The top panel has height 27px in GS < 40, but 32px in GS 40...