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
Allow clock widget to be optionally placed back at middle of panel #60
Comments
You want the date and time in the dead center of the panel (like stock gnome)? Do I understand correctly? |
Yep, my assumption is that the setting "Clock location" -> "Natural" would be the same as the original panel, i.e. in the center. For me, that setting places the Date/Time widget on the left-most edge of the right hand corner widgets. I'd be happy to work on a patch if you can point me in the write direction. |
In gnome, the main panel is split in 3 containers (_leftBox, _centerBox, _rightBox). This extension overrides the allocation in panel.js so that the center container is moved directly next to the right container. So, basically, the default behavior just needs to be called instead of the override to have the centerBox back to the center. That includes everything in the center though (so if you added additional center items via extensions, such as openWeather). I'm not decided how to most clearly represent that option in the settings though. The existing setting is specific to the clock widget and whether it should be moved from the center container to the right container. Maybe a new setting under the Advanced dialog menu? |
Having the option to move the clock to the centre is a 'must have' in my opinion.. |
@jderose9 i think that @willismonroe want something like this I'm not familiar with javascript and extensions coding, simply change __setClockLocation if(loc == "NATURAL") {
// only move the clock back if it's in the right box
if ( rightBox.get_children().indexOf(dateMenu.container) != -1 ) {
rightBox.remove_actor(dateMenu.container);
centerBox.add_actor(dateMenu.container);
}
else {
dateMenu.container.set_x_align(Clutter.ActorAlign.CENTER);
dateMenu.container.set_x_expand(true);
}
} else { and _allocate let sideWidth = allocWidth - rightNaturalWidth - centerNaturalWidth;
//DIRTY: Correcting real width of leftBox
sideWidth = Math.min(sideWidth, leftNaturalWidth);
let childBoxLeft = new Clutter.ActorBox();
childBoxLeft.y1 = 0;
childBoxLeft.y2 = allocHeight;
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
childBoxLeft.x1 = allocWidth - Math.min(Math.floor(sideWidth), leftNaturalWidth);
childBoxLeft.x2 = allocWidth;
} else {
childBoxLeft.x1 = 0;
childBoxLeft.x2 = sideWidth;
}
this.panel._leftBox.allocate(childBoxLeft, flags, true);
let childBoxRight = new Clutter.ActorBox();
childBoxRight.y1 = 0;
childBoxRight.y2 = allocHeight;
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
childBoxRight.x1 = 0;
childBoxRight.x2 = rightNaturalWidth;
} else {
childBoxRight.x1 = allocWidth - rightNaturalWidth;
childBoxRight.x2 = allocWidth;
}
this.panel._rightBox.allocate(childBoxRight, flags, true);
let childBoxCenter = new Clutter.ActorBox();
childBoxCenter.y1 = 0;
childBoxCenter.y2 = allocHeight;
if (this.panel.actor.get_text_direction() == Clutter.TextDirection.RTL) {
// childBoxCenter.x1 = rightNaturalWidth;
// childBoxCenter.x2 = childBoxRight.x1 + centerNaturalWidth;
childBoxCenter.x1 = childBoxRight.x1;
childBoxCenter.x2 = childBoxLeft.x2;
} else {
// childBox.x1 = allocWidth - centerNaturalWidth - rightNaturalWidth;
// childBox.x2 = childBox.x1 + centerNaturalWidth;
childBoxCenter.x1 = childBoxLeft.x2;
childBoxCenter.x2 = childBoxRight.x1;
}
this.panel._centerBox.allocate(childBoxCenter, flags, true);
let childBox = new Clutter.ActorBox(); behaviors in panel.js But keep in mind that its hack, for my custom situation (i dont use appMenu). For appMenu it would be great make complex decision. IMHO, mac style is best, but I dont know how to implement it on a small displays. |
@jderose9 or maybe just keep the original position for objects on center and right position? I have two objects in center (Weather and Clock) and the rest on right position: |
i would also like to say that not having a way to put the clock back to the middle is very unfortunate because it is something i would like alot. |
yes, i would like the clock and date in the centre too, its something that I have gotten used to... |
I also would like to suggest adding an option to place the clock at the center of the bar :) |
yes please give the open to leave all centered widgets (clock, openweather, etc.) alone where gnome has defaulted them to be for so long. |
I also agree. It would be great to have an option "clock in the center". |
I really miss the ability to put the clock and openweather widget in the center. |
Have a look at this answer : https://askubuntu.com/a/948120/661482 |
i just discovered "frippery panel favorites" extension, which simply adds the favorites launchers to the panel without disturbing the placement of other extensions, and since uninstalled dash to panel. |
Great plugin, but yeah, this is a big stopper for me. I've been sticking with the Taskbar extension for almost a year hoping that Dash-To-Panel would one day finally add an option to center the clock. |
seconding this, I would also like to have the option to center my clock + weather while using Dash to Panel. I could have sworn I hade it before I disabled and started messing around with the Dock but I guess not. Driving me nuts, great extension though! |
I've added two new taskbar positions and adjusted the description of the existing options. The options now are:
The * are the new options which are intended to address this issue. Any feedback on the new descriptions or the behavior of the options would be appreciated! Available now in |
Works good over here 👍 |
Hi, tnilzon here: |
Hi, I downloaded Dash-to-panel from Gnome Shell extension and I don't have this functionality. Best regards. |
Hi, Thank you so much, it is exactly what I looked for! Best regards! |
Great, thanks! This in in v16 and live on e.g.o. |
I'm not seeing the new center options (I just checked e.g.o and I'm running the most recent version). I have:
|
@willismonroe they are actually under the taskbar position settings. It's confusing because gnome breaks the panel up into left, center and right boxes. The center box typically contains the clock and some other plugins such as open weather. What dash-to-panel did before was to push the center box all the way to the right, directly next to the right box content. I you chose to move the clock next to the status icons, it would actually remove it from the center box and into the right box. So, to get the clock in the center you need to leave the center box in the center, and leave the clock in the center box. I'm definitely open to improving this as I would like it to be easy for someone to understand without a paragraph explaining the inner-workings of gnome. Better wording maybe, or a screenshot or highlighting sections of the panel could help? |
Thanks @jderose9 for that thorough explanation. I guess it's still not exactly what I was looking for, here's the result: centering the "center box" moves all the open application icons also to the middle. That all being said, it's still a great extension, and the way I use gnome Shell. |
@willismonroe What is the configuration you are looking for? If you want the clock in the center, put the taskbar position as "Left, with fixed center plugin icons" and the Clock location as "left/right of plugin icons". |
Ah, that was perfect! Thanks.
…On Tue, Sep 25, 2018 at 3:09 AM Jason DeRose ***@***.***> wrote:
@willismonroe <https://github.com/willismonroe> What is the configuration
you are looking for? If you want the clock in the center, put the taskbar
position as "Left, with fixed center plugin icons" and the Clock location
as "left/right of plugin icons".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AArpylvH1uv5s9xvA71EppFaOUtSkIJgks5uegDYgaJpZM4L48HF>
.
|
:) A bit cryptic, but works beautifully! Great job! |
I'd definitely like to improve the wording on these two settings. Suggestions welcome :) |
It seems that this centers the pair "clock and app menu", which means that when changing application, the app menu will have a different label (for example "Google Chrome" instead of "Tweaks"). This will change the size of the app menu button, and will slightly offset the clock. The end result is that the clock wiggles left and right everytime the user switches between applications. A workaround could be to not show the App Menu at all, but this may be undesirable for some applications. |
Is there a way to center the Date and Time widget?
The text was updated successfully, but these errors were encountered: