summaryrefslogtreecommitdiff
path: root/mate-panel/panel-widget.c
AgeCommit message (Collapse)AuthorFilesLines
2022-08-20Fix center- and right-sticking of expanding appletsGordon Norman Squash1-26/+121
In a prior commit (38e00280e9d17282717595a05411736a308804c0), I added support to stick applets to the center of the panel, so that no matter the width of the applet or the panel, the applet would always stay at the center of the panel. That commit also added an "end-relative" mode, which is similar to the panel's old "right-stick" feature, except end-relative mode positions the applet's right edge relative to the panel's right edge, whereas right-sticking positioned the applet's left edge relative to the right edge of the panel. The advantage of end-relative positioning is that the applet can resize without moving itself even further to the right than the user intended, whereas if positioned so that there is empty space between the applet and the edge of the panel, right-stuck applets would change the size of that gap (or close it entirely) when the applet resized. Unfortunately, I have since discovered that my original implementation of the center-stick and end-relative positioning of applets was inadequate. Some applets can accept any amount of space between a minimum and their "preferred" size -- if such an applet cannot be allocated its preferred size (perhaps because panel space is scarce), then the applet will be allocated as much space as is available, and the applet will "flex" itself to compensate. Some examples of these "expanding" applets include the Window List (a component of the wncklet included in this package) and the MATE Dock Applet (a third-party panel applet from the Ubuntu MATE project). When writing my original center-stick code, I did not properly take expanding applets into account, and with my original commit, such applets were off-center -- usually way off-center since the code seemed to position such applets based on their minimum size, rather than their actual allocated size. This commit adds center-sticking support for expanding applets. It also works with end-relative expanding applets -- such applets will expand towards the left, thus keeping their right-relative position intact.
2022-06-01Add "center-stick" capability applets on the panelThe Squash1-71/+268
Conventionally, the applets on a MATE Panel are positioned relative to the left edge of the panel (if the panel is horizontal) or the top edge (if the panel is vertical). There has also been some (buggy) support for positioning of applets relative to the right (or bottom) edge of the panel, so that applets on the right side of the panel will stay on the right side even if the user changes screen resolutions or if the panel changes size for some other reason. However, many users want to also place applets at or near the center of their panel(s). There is no such conventional support for positioning applets relative to the center of the panel, so users have positioned applets near the center of the panel -- but the position recorded is relative to the left side of the panel. As such, the applets will almost certainly shift over to the left or right slightly if the panel is ever resized, and the user will have to reposition all those centered applets yet again. This is especially frustrating if the user switches monitors on a regular basis! This patch radically revamps the MATE Panel's positioning framework, and deprecates the original "right-stick" feature. To replace the right-stick feature, this patch instead associates an "edge relativity" setting with each and every panel applet: An applet can be relative to the start (left/ top), end (right/bottom), or center of the panel. This setting can be changed using DConf/GSettings, using a custom panel layout file, or even by simply dragging the applet to the appropriate place on the panel. (Conventionally, applets are not even right-stuck automatically even when the user drags the applet over to the far right of the panel!) As a bonus, when the user drags an applet across the center of the panel, the applet will temporarily "stick" to the very center of the panel, to allow the user to very precisely align any applet they wish.
2022-01-26Fix implicit conversion changes signedness: 'gboolean' to 'guint'rbuj1-7/+7
2021-12-20Use dashes for applet-[added|removed|move], back-change, size-changerbuj1-5/+5
2021-12-20Remove unnecessary cast in g_signal_connect* callrbuj1-4/+4
2021-12-16Use g_clear_pointer() and g_clear_object()rbuj1-12/+4
2021-12-11Use a blank line at mostrbuj1-7/+0
2021-06-22update copyright to 2021raveit651-0/+1
2020-09-07Remove variableScope warnings reported by cppcheckrbuj1-12/+6
cppcheck --enable=all . 2> err.txt grep variableScope err.txt
2020-07-05Avoid using single-line cpp commentsrbuj1-2/+2
2019-09-15When determining whether the pos is in the applet, use ad->cells to calc.Wu Xiaotian1-1/+1
2019-07-05Remove trailing whitespacesLaurent Napias1-70/+70
2019-06-23Fix unused variable in panel-widget.cWilliam Wold1-3/+3
2019-03-10Wayland support for panel-widget.cWilliam Wold1-0/+7
2018-06-29panel-widget: replace deprecated gdk_flushraveit651-3/+5
2018-01-31require GTK+ 3.22 and GLib 2.50monsta1-200/+5
2018-01-25Support panel auto-scaling for HiDPI displaysVictor Kareh1-6/+12
*Fix scaling of panel widgets, buttons, and the menu bar *Draw grab handles at the ends of the panel *Fix size of _almost_ all included applets *Fix panel snapping coordinates *Down-scale monitor coordinates to support multi-monitors Author: Victor Kareh <[email protected]> Date: Wed Dec 20 14:03:18 2017 -0500
2017-12-27Fix build warning: ‘toplevel_configure_event’ defined but not usedPablo Barciela1-4/+0
2017-10-05Stop panel collapse left on adding certain out-of-process appletslukefromdc1-0/+1
Stop panel from collapsing left on adding fish, moving window-list(or other wncklet applet) on otherwise empty panel Fixes https://github.com/mate-desktop/mate-panel/issues/661
2017-05-29fix moving applets between panelsmonsta1-4/+6
fixes https://github.com/mate-desktop/mate-panel/issues/504 have to repeat my change from 024f89bc7c8074f753120d9c8ec4bd839745984b because of fallout from 225702b3c6a609065465c66f0f2739fc1d2184a9
2017-04-10properly fit expanded panel to smaller screen sizemonsta1-9/+1
when changing panel orientation or rotating the screen itself, panel might keep its old size, so some applets might appear behind screen edge (until you restart the panel). same thing might happen when enabling hide buttons. fixes https://github.com/mate-desktop/mate-panel/issues/552 upstream commit with detailed problem description: https://git.gnome.org/browse/gnome-panel/commit/?id=fc24d8fa623c4cf841eb5168cb1c250b4a84d4da upstream commit with the actual fix: https://git.gnome.org/browse/gnome-panel/commit/?id=4511f4466df0b163906794b4a32196226ccf90f3 yes, it's somewhat messed up there :)
2016-11-21move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build optionmonsta1-182/+10
and require libmate-desktop >= 1.17 WARNING: use GTK+3 build of libmateweather for this build. that lib is not migrated to GTK+3 only as we will possibly use libgweather instead of it.
2016-11-21panel-widget: panel_widget_unrealize is used only with GTK+ < 3.18monsta1-1/+2
2016-11-21check for stable release of GTK+3, not for development onemonsta1-1/+1
2016-11-21fix indent a bitmonsta1-0/+1
2016-09-07GTK+-3.20 panel-widget: use GtkSeat instead of deprecated device pointerraveit651-6/+6
2016-08-03GTK+-3 panel: don't set panel's initial size to G_MAXINTraveit651-3/+11
Replacing GtkTable with GtkGrid introduced new bug. Warning is - 'Native children wider or taller than 65535 pixels are not supported'. This is caused by setting panels initial size to G_MAXINT. Changing initial size to 0 fixes this new bug. taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=02ce072
2016-06-29fix some warnings and deprecationsSorokin Alexei1-11/+46
2016-06-29Gtk3: rename panel_widget_size_request() to panel_widget_get_preferred_size()Sorokin Alexei1-48/+106
2016-06-08fix missing focus for panel widgetsraveit651-0/+1
credits and thanks to Joanmarie from orca project fixes partially https://github.com/mate-desktop/mate-panel/issues/441 https://github.com/mate-desktop/mate-panel/issues/440 https://github.com/mate-desktop/mate-panel/issues/444
2016-03-25Gtk3.18/3.20-move background handling toplevellukefromdc1-24/+38
panel-widget.c move background handling to the panel toplevel in GTK 3.18 and GTK 3.20 builds only, seems to fix the applet crashes on theme changes with a custom background loaded, and in GTK 3.20 also preserves custom backgrounds when GTK themes are changed
2016-03-13GTK 3.20-Prevent transparent panel on BG changelukefromdc1-2/+3
The mate-custom-panel-background style class persists on the panel widget when resetting the panel BG to the system theme. It will overrride the panel system theme and turn the panel transparent with the new applet changes for some reason, so don't run panel_background_apply_css on GTK 3.20 builds. It's not needed to override t.he theme background for a custom background with the new code and GTK 3.20, and mate-panel-menu-bar is already present
2016-02-27GTK3.20: preserve default backgroundlukefromdc1-0/+3
Add back the default background for themes such as Adwaita that do not explicitly support MATE. Tested with custom and system themes in Adwaita and all themes I have. System themes work perfectly, custom themes require restarting panel after any theme change, still need to restart panel after returning to the system theme from a custom theme as well.
2016-02-27gtk3.20: custom background work on main panellukefromdc1-1/+4
This makes custom backgrounds show on the panel, the menu, the launcher applets but not yet the tray, the clock button, the trash, or most applets from mate-applets. Sometimes panel BG not drawn after theme change until panel restarted. Still, this is a clue-will keep working. Adding gdk_window_ensure_native (window) was taken from gnome-panel but caused the default background not to show if the system BG is selected and does not explicitly set the theme. Also using this brings back the requirement to restart the panel to fully apply a system BG but progress is being made here.
2016-02-21fix some warningsSorokin Alexei1-0/+4
2016-02-12Gtk+-3 panel-widget: don't use deprecated get_background_colorWolfgang Ulbrich1-7/+10
taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=539ecc4
2016-02-12do not use deprecated gdk_cursor_new, useWolfgang Ulbrich1-3/+5
gdk_cursor_new_for_display for both GTK versions
2016-02-09panel-widget: set css nameWolfgang Ulbrich1-0/+4
taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=201f16b
2016-01-05rename mate-panel-*.{c|h} -> panel-*.{c|h} for consistencymonsta1-1/+1
(libmate-panel-applet files are left alone since there are public header files used by all panel applets)
2016-01-04background: group some local functions by GTK+ versionmonsta1-20/+18
2016-01-04background: even less #if'smonsta1-7/+7
2016-01-04background: less #if'smonsta1-18/+18
2016-01-04background: all functions should have PanelBackground as 1st argumentmonsta1-1/+1
2015-12-21panel-widget: drop unused variables (assigned but never read after)monsta1-10/+0
2015-11-20Don't set the panel transparent by defaultBalló György1-0/+1
This fixes the background for GTK+ 3 themes which don't support mate-panel explicitly. Themes could still overwrite the background if they want in the usual way.
2015-10-26bring back good old deprecated function which works perfectlyMonsta1-3/+1
thanks to some genius from gnome team, we're now supposed to re-implement gtk_widget_reparent from scratch in every place we need to move a widget between containers. thanks but no thanks. don't fix what's not broken. fixes #360
2015-08-26Always use gtk_container_remove/gtk_container_addinfirit1-4/+1
Should work fine under both Gtk+ versions.
2015-08-26Gtk3: Don't use deprecated gtk_widget_reparentyetist1-0/+5
2015-08-26Gtk3: Don't use deprecated gdk_cursor_newyetist1-2/+1
2015-08-26Gtk3: Don't use deprecated gdk_window_get_pointeryetist1-0/+8