summaryrefslogtreecommitdiff
path: root/src/ui/theme.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-06i18n: Use glib's gettext support macrosrbuj1-0/+2
2020-09-01theme: macro "ALPHA_TO_UCHAR" is not usedrbuj1-2/+0
2020-08-04Remove multiple empty linesrbuj1-4/+0
find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 'N;/^\n$/D;P;D;' {} \;
2020-08-04Remove trailing spaces/tabsrbuj1-1/+1
find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 's/[[:space:]]*$//' {} \; find . \( -name '*.h' -o -name '*.c' \) -exec sed -i 's/\t*$//' {} \;
2020-02-21theme: avoid deprecated g_memmovercaridade1451-3/+3
https://gitlab.gnome.org/GNOME/glib/commit/6554c91b https://gitlab.gnome.org/GNOME/glib/commit/6e4a7fca based on https://gitlab.gnome.org/GNOME/metacity/commit/359f60a6
2019-12-05theme.c: Fix window control hidpi rendering for all themes.Michael Webster1-3/+15
By scaling the pixbuf when loading, existing assets can be used.
2019-10-07theme: Render window control buttons and icons as surfacesVictor Kareh1-24/+290
When loading window control buttons and icon as pixbufs, we just set them as the source for the cairo context used to paint them. Instead, we now convert them to cairo surfaces and scale them to the correct display density before painting them. This allows us to load higher resolution assets (i.e. at twice the size) and by explicitly setting the intended size in the theme draw_ops, we can then scale them down to fit lower resolution displays, or render them at full density for HiDPI displays.
2019-06-05theme: Fix window state when tiling from maximizedVictor Kareh1-0/+2
2019-06-05theme: fix warningVictor Kareh1-0/+1
upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/3a3c47e3
2019-06-05theme: don't add invisible borders for windows that can't be resizedVictor Kareh1-7/+14
Invisible borders are all about resizing -- in the case that a window cannot be resized, it makes no sense to add them. https://bugzilla.gnome.org/show_bug.cgi?id=659854 Based on mutter commit: https://git.gnome.org/browse/mutter/commit/?id=be9f7d77292c1dfd868640fe95f7223fbbfd4273 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/64615667
2019-06-05theme: Don't add any bottom border to shaded windowsVictor Kareh1-4/+4
Shaded windows are assumed to be reduced to the titlebar: the current code enforces a visible bottom border of 0 and only takes the size of the title bar (+ invisible top border) into account when resizing the frame. However, we still add an invisible border at the bottom, which is than subtracted from the title bar, resulting in shaded windows being cut off. Fix by forcing both visible and invisible bottom borders to 0. https://bugzilla.gnome.org/show_bug.cgi?id=659266 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/7a80fcfd
2019-06-05ui: Replace inline borders in MetaFrameGeometry with MetaFrameBorderVictor Kareh1-46/+46
... and start compensating for invisible borders in all of the math. https://bugzilla.gnome.org/show_bug.cgi?id=644930 NOTE: Updated for marco... upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/daf6bc08
2019-06-05MetaFrameBorders: add invisible bordersVictor Kareh1-0/+10
This just adds the invisible border field and populates it with data but doesn't use it in any way. Based on mutter commit: https://git.gnome.org/browse/mutter/commit/?id=a1a2527c75ab0c135f89396ea036336fb67ac538 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/bf02c7c3
2019-06-05theme: add invisible_border to metacity themeVictor Kareh1-0/+5
This adds 'invisible_border' to be used for resize cursor area.
2019-06-05theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widgetVictor Kareh1-37/+13
The style context of the widget is rarely what we want. We won't fix this to be a MetaFrames style context yet; this just changes the internal API. https://bugzilla.gnome.org/show_bug.cgi?id=690317 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/76aa0704
2019-06-05MetaFrameBorders: Add meta_frame_borders_clearVictor Kareh1-13/+3
Just a quick little commit to help clean things up for when we add invisible borders. Additionally, do a little housekeeping in preview-widget as well. https://bugzilla.gnome.org/show_bug.cgi?id=644930 NOTE: Patch copied from metacity and adapted for marco. upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/7d519b3f
2019-06-05Replace public MetaFrameGeometry with MetaFrameBordersVictor Kareh1-52/+31
There were actually *two* MetaFrameGeometry structs: one in theme-private.h, one in frame.h. The latter public struct was populated by a mix of (void*) casting and int pointers, usually pulling directly from the data in the private struct. Remove the public struct, replace it with MetaFrameBorders and scrap all the pointer hacks to populate it, instead relying on both structs being used in common code. This commit should be relatively straightforward, and it should not do any tricky logic at all, just a sophisticated find and replace. https://bugzilla.gnome.org/show_bug.cgi?id=644930 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/72224a165 NOTE: Patch copied from metacity and adapted for marco.
2019-06-01libmetacity: use cairo to render gradientVictor Kareh1-54/+91
upstream commits: https://gitlab.gnome.org/GNOME/metacity/commit/71d5decc https://gitlab.gnome.org/GNOME/metacity/commit/127638ca https://gitlab.gnome.org/GNOME/metacity/commit/fc1a21ea https://gitlab.gnome.org/GNOME/metacity/commit/431e0418
2019-04-08Remove GDestroyNotify function cast for g_object_unrefrbuj1-1/+1
2019-03-28Improve performance by removing unused assignmentsrbuj1-5/+3
2019-01-31Increase icon size on tab and workspace popupsVictor Kareh1-1/+5
Alt+Tab and Workspace popups should be sized relative to the monitor size. This way they look nice and large regardless of the display resolution. Also, given much larger modern resolutions, icon sizes should be larger by default.
2018-08-28theme: add invisible_border to metacity themeAlberts Muktupāvels1-0/+5
This adds 'invisible_border' to metacity theme. This invisible border will be used for resize cursor area.
2018-08-28add support for app-menu button in themeAlberts Muktupāvels1-2/+27
Add app-menu button support in themes. This is done only to support metacity theme format 3.5 version. Marco will not show this button! Based on metacity commit: https://gitlab.gnome.org/GNOME/metacity/commit/6a2cc159
2018-08-28theme: replace mutter/metacity with marcoVictor Kareh1-1/+1
2018-08-28theme: Replace char array element comparisons with strncmpJasper St. Pierre1-19/+7
https://bugzilla.gnome.org/show_bug.cgi?id=662962
2018-08-28theme: Allow disabling fallback colors in gtk:custom()Florian Müllner1-4/+20
gtk:custom() requires a fallback color in case the GTK+ theme in use does not define the desired color. As in general the fallback color will approximate the intended color, there is the risk of typos going unnoticed. To make catching these kind of errors easier, allow to ignore the fallback color specified (and fall back to a nice shade of pink instead) by setting an environment variable. https://bugzilla.gnome.org/show_bug.cgi?id=656112
2018-08-28theme: Allow using custom colors from the GTK+ themeFlorian Müllner1-1/+90
Add an additional color type to pick up colors defined with @define-color in the GTK+ theme's CSS: gtk:custom(name,fallback) (where "name" refers to the name defined in GTK+'s CSS, and fallback refers to an alternative color spec which is used when the color referenced by "name" is not found) The main intent of the change is to allow designers to improve Adwaita's dark theme variant without having to compromise on colors which work in the light variant as well. https://bugzilla.gnome.org/show_bug.cgi?id=648709 NOTE: Patch copied from mutter and adapted for metacity.
2018-08-28theme: Add background functions for single buttonsFlorian Müllner1-18/+41
With the existing background functions, single buttons can not be styled separately - on the left side, the style of the left button is picked, and the right button's style on the right side. As theme authors may want to add rounded corners to button groups as a whole, it makes sense to treat the case of a single button in a group differently. https://bugzilla.gnome.org/show_bug.cgi?id=635683 NOTE: Patch copied from mutter and adapted for metacity.
2018-08-28Add frame type for attached modal dialogsOwen W. Taylor1-2/+9
Add a new frame type META_FRAME_TYPE_ATTACHED which is used for attached modal dialogs. The theme format version is bumped to 3.2, and attached windows can have borders defined in a metacity-theme-3.xml as: <window version=">= 3.2" type="attached" style_set="[name]"/> If no style is defined for "attached", drawing will fall back to the "border" type. https://bugzilla.gnome.org/show_bug.cgi?id=592382 NOTE: Patch copied from mutter and adapted for metacity.
2018-08-28Allow a theme to specify ellipsize width for a titleOwen W. Taylor1-3/+40
It's nice to indicate when a title is truncated with an ellipsis. Because themes may draw a title multiple times to draw a shadow, or may include the window icon within the title area, we can't determine the proper ellipsization width automatically, so add an optional attribute to the <title/> element "ellipsize_width" which, if set, is the width to ellipsize at. This is only enabled if a theme version of 3.1 is required. When it's not set, we keep the old behavior of just letting the title be clipped with a hard edge. https://bugzilla.gnome.org/show_bug.cgi?id=591842 NOTE: Patch copied from mutter and adapted for metacity.
2018-08-28Add frame_x_center/frame_y_center variables for themesOwen W. Taylor1-0/+14
Sometimes you want to position something (usually the title) to be centered with respect to the entire frame instead of centered with respect to the individual piece currently being drawn. This patch adds frame_x_center and frame_y_center variables that represent the X/Y centers of the frame in the coordinate system of the piece being drawn. The theme version is bumped from 3.0 to 3.1 (3.0 is just the new version system, 3.1 will have all the features we add for Mutter-2.28.) position expressions https://bugzilla.gnome.org/show_bug.cgi?id=591842 NOTE: Patch is copied from mutter and is adapted for metacity.
2018-08-28metacity-theme-3.xml: Add a flexible version mechanismOwen W. Taylor1-3/+3
The current mechanism of metacity-theme-1.xml and metacity-theme-2.xml is not flexible for allowing small-scale additions. With this patch we bump the major version version once more to metacity-theme-3.xml and add a single feature: Any element in the DTD can have an attribute: version="[<|<=|=>|>] MAJOR.MINOR" And it will be ignored unless the predicate is met. (< and > should be to be entity escaped as &lt; and &gt;) This allows having alternate sections of the theme file for older and newer version. * Required GLib version is bumped to 2.14 so we can parse versions with a regular expression. * We switch internal version numbers to be "1000 * major + minor" * We keep a stack of the maximum required version for the current portion the XML tree so that the "cannot use versions you don't require" stricture of the old code can be made local to a subpart of the tree. * A version on the top metacity_theme element causes the entire file to be ignored; this allows having one metacity-theme-3.xml for version 3.2 and newer (say) and a metacity-1.xml for everything old. Actual new features will be added starting with 3.1 - 3.0 is just the version="" feature. http://bugzilla.gnome.org/show_bug.cgi?id=592503 NOTE: Patch is copied from mutter and adapted for metacity. origin commit: https://gitlab.gnome.org/GNOME/metacity/commit/114a2048
2016-10-15move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build optionmonsta1-627/+0
2015-11-20Gtk3: fix colorsBalló György1-0/+4
Add GTK_STYLE_CLASS_BACKGROUND class to context, so we have correct colors from the GTK+ theme instead of white text over black background.
2015-09-24gtk3: fix assertion 'gtk_widget_get_realized (widget)' failedDenis Gorodnichev1-0/+2
gtk3 can use style context before widget realization
2015-09-14theme: Rename button_rect() to get_button_rect()Florian Müllner1-6/+6
Basically it's odd to have "button_rect" be a function with all the foo_rect GdkRectangles around - renaming to get_button_rect() will free the name for the generically named "rect" once buttons are the only movable pieces in the frame. https://bugzilla.gnome.org/show_bug.cgi?id=741917
2015-09-14Clean up antialiasing fixesOwen W. Taylor1-24/+11
Simplify the code by noting that when we have square end-caps, the results of generic line path give the right pixel-aligned rectangle for horizontal/vertical lines. Add comments and remove some extra braces. https://bugzilla.gnome.org/show_bug.cgi?id=630426
2015-08-20Gtk3: Fix background colorinfirit1-10/+71
Also drop the mate-desktop dark/light color functions in favour of internal ones.
2015-07-17theme: Remove outdated assertionYaakov Selkowitz1-1/+0
The theme state used to use GtkStateType, but was ported over to GtkStateFlags, leaving behind a broken assertion that fails when using certain Metacity themes, for example Nodoka. https://bugzilla.gnome.org/show_bug.cgi?id=661286 https://git.gnome.org/browse/mutter/commit/?id=28deea4 https://git.gnome.org/browse/metacity/commit/?id=c9099b4 https://github.com/mate-desktop/marco/issues/205
2014-11-25merge metacity(gtk3) changesDenis Gorodnichev1-151/+360
merge metacity(gtk3) changes fix warnings clean up unused variables replace UNUSED_VARIABLE by G_GNUC_UNUSED
2014-11-18Add missing ';'Stefano Karapetsas1-1/+1
Closes https://github.com/mate-desktop/marco/issues/149
2014-11-12buttons: Fix background functions for non-default layoutsinfirit1-2/+103
While the configured layout is taken into account for positioning the buttons, the mapping from button function states to button position states just assumed the default button layout in LTR locales. Do a proper mapping depending on the actual layout instead. Based on metacity commit: 6a52883c2b670ad645257373515d1e704408b93d From: Florian Müllner <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=638700
2014-11-12Fix drawing of <arc> elementsinfirit1-1/+1
This patch fixes the drawing of <arc> theme elements to appear in the desired orientation Based on metacity commit: 120c7790d6c5a837372ef1e0105e89ac674facd8 From: Nickolas Lloyd <[email protected]>
2014-10-27Rework tiling code based off Consortiuminfirit1-2/+61
Taken from https://github.com/SolusOS-discontinued/consortium/commit/b463e03f5bdeab307ceee6b969c681f29537c76d
2014-06-26Remove all trailing whitespaces in the code treeJoaquín Ignacio Aramendía1-7/+7
Just run: $ find -name '*.c' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i $ find -name '*.h' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i
2014-04-23GTK3 fixesStefano Karapetsas1-0/+4
2014-04-23GTK3 fixesStefano Karapetsas1-2/+31
2014-02-17Cut with fading the Bar title when it's longer than the decoration bar.Omer Akram1-0/+27
2014-01-24ui: Improve GTK3 supportStefano Karapetsas1-4/+26
2013-10-26Starting to add GTK3 supportLaszlo Boros1-17/+324