Commit Graph

12664 Commits

Author SHA1 Message Date
Carlos Garnacho
f7e7201f11 Fix docs typo. 2010-12-04 15:39:51 +01:00
Carlos Garnacho
daab45565a GtkCssProvider: Fix up state matching when looking up style properties. 2010-12-04 15:39:51 +01:00
Carlos Garnacho
297fa7a3dd GtkStyleProvider: Add GtkStateFlags parameter to get_style_property().
Widget style properties can now have different values depending on the
current state.
2010-12-04 15:39:51 +01:00
Carlos Garnacho
2ca905db5e GtkStyleContext: Handle directionality when picking next provider. 2010-12-04 15:39:50 +01:00
Carlos Garnacho
46de2130d3 GtkWidget: unset NULL properties when overriding style. 2010-12-04 15:39:50 +01:00
Carlos Garnacho
64b7d9e5c1 GtkThemingEngine: Render gradients in tabs.
Background will be actually rotated in tabs, so the "bottom" side coincides
with the junction point, this makes gradients work as expected in rotated tabs.
2010-12-04 15:39:50 +01:00
Carlos Garnacho
32c2b13969 GtkThemingEngine: split background rendering to a private function. 2010-12-04 15:39:50 +01:00
Carlos Garnacho
4c1a2426d4 GtkStyle: Commit a few typos when translating states. 2010-12-04 15:39:49 +01:00
Carlos Garcia Campos
4aaf193602 docs: gtk_style_context_get_screen() always returns a valid screen 2010-12-04 15:39:49 +01:00
Carlos Garcia Campos
7a5a622998 Check screen really changed before notifying it and invalidating the context 2010-12-04 15:39:49 +01:00
Carlos Garcia Campos
7abf76fbc1 Initialize screen of GtkStyleContext to default screen 2010-12-04 15:39:48 +01:00
Matthias Clasen
587c08a151 Add explanation to failing test 2010-12-04 15:39:48 +01:00
Matthias Clasen
12d6b5889d Add a testcase a problem with style property handling 2010-12-04 15:39:48 +01:00
Matthias Clasen
f86e8f7512 Allow images for background-image
In addition to -gtk-gradient(...), allow url(path), and create
a pattern from the image. Still to do: allow stretch/repeat options.
2010-12-04 15:39:48 +01:00
Matthias Clasen
ca143b1303 Add list of classes and regions to the docs 2010-12-04 15:39:48 +01:00
Matthias Clasen
897c370f5f Avoid compiler warnings 2010-12-04 15:39:47 +01:00
Matthias Clasen
5adfe6029d Don't add class "scrollbar" for every trough
Turns out "trough" as a detail string is used in a variety
of widgets, not all of which are scrollbars.
2010-12-04 15:39:47 +01:00
Matthias Clasen
2578f4f4c3 Trivial doc fixes 2010-12-04 15:39:47 +01:00
Matthias Clasen
e598f17871 Some header cleanups
Move GtkGradient to their own files, also move GtkBorder out of
gtkstyle.h, so that header can be all deprecated.
2010-12-04 15:39:47 +01:00
Matthias Clasen
1915a19503 Add deprecation notes 2010-12-04 15:39:46 +01:00
Matthias Clasen
f8a874abb1 Initial attempt at deprecating GtkStyle api
This will probably need some finetuning.
2010-12-04 15:39:46 +01:00
Matthias Clasen
bbca96044e Fix memory handling when dealing with colors 2010-12-04 15:39:45 +01:00
Matthias Clasen
53c2114356 Deprecate gtk_icon_info_load_symbolic_for_style
We might end removing it altogether since it is a bit silly to have
Since: 3.0
Deprecated: 3.0
2010-12-04 15:39:45 +01:00
Carlos Garnacho
e9ef162d4c GtkSpinner: Use style context for rendering.
Animation is now handled by the theming layer, a looping animation
has been defined in the default CSS to handle active spinners.
2010-12-04 15:39:45 +01:00
Carlos Garnacho
3d956b10ee GtkStyleContext: handle prelight transitions 2010-12-04 15:39:44 +01:00
Carlos Garnacho
c90bee16ba GtkThemingEngine: Handle prelight transitions in render_layout() 2010-12-04 15:39:44 +01:00
Carlos Garnacho
e696c24f08 GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so 2010-12-04 15:39:44 +01:00
Carlos Garnacho
11004ef61d Initialize all looping, active state transitions on map()
This allows widgets to gtk_widget_set_state_flags() before mapping
and have animations started anyway when this happens.
2010-12-04 15:39:44 +01:00
Carlos Garnacho
4027dceaa9 Add #define for the "spinner" style class 2010-12-04 15:39:44 +01:00
Carlos Garnacho
62e9188ff3 GtkStyleContext: store layout extents for animation purposes. 2010-12-04 15:39:43 +01:00
Carlos Garnacho
818aca5aee GtkStyleContext: Only allow looping transitions for states being turned on. 2010-12-04 15:39:43 +01:00
Carlos Garnacho
ad6da0cdb8 GtkStyleContext: Stop animations if the window is gone. 2010-12-04 15:39:43 +01:00
Carlos Garnacho
cc18d65986 GtkThemingEngine: render square corner if the gap is too close on render_frame_gap() 2010-12-04 15:39:43 +01:00
Matthias Clasen
f0eed4a5b1 Use gtk_icon_info_load_symbolic_for_context
gtk_icon_info_load_symbolic_for_style is going to be deprecated.
2010-12-04 15:39:43 +01:00
Matthias Clasen
f90881271f Add a GtkStyleContext-variant of symbolic icon loading 2010-12-04 15:39:42 +01:00
Matthias Clasen
0f98b15090 Add illustration to gtk_render_handle docs 2010-12-04 15:39:42 +01:00
Matthias Clasen
3ddee2561b Small doc addition 2010-12-04 15:39:42 +01:00
Matthias Clasen
d1f1af202b Add a frame-gap illustration 2010-12-04 15:39:42 +01:00
Matthias Clasen
1391a61bc5 Improve frame-gap drawing
Instead of overdrawing the gap with bg-color, clip it away.
2010-12-04 15:39:42 +01:00
Matthias Clasen
54eadfcefd Fix another parameter mismatch 2010-12-04 15:39:42 +01:00
Matthias Clasen
b51c0f826a fix parameter name mismatch 2010-12-04 15:39:41 +01:00
Carlos Garnacho
9c0ef02ea5 GtkButton: Remove unneeded gtk_style_context_notify_state_change() calls
There is now code to handle this for one-item widgets (such as GtkButton)
in gtk_widget_set_state_flags()
2010-12-04 15:39:41 +01:00
Carlos Garnacho
2f0b5d8a9d GtkCheckButton: Look active when the pointer button is pressed and hovering 2010-12-04 15:39:41 +01:00
Carlos Garnacho
037c982824 GtkStyleContext: Handle empty areas when coalescing invalidation regions. 2010-12-04 15:39:41 +01:00
Carlos Garnacho
2fb9687f55 GtkToggleButton: Make it able to be prelight and active at the same time. 2010-12-04 15:39:40 +01:00
Carlos Garnacho
1d5a6b687e GtkComboBox: Use style context for rendering 2010-12-04 15:39:40 +01:00
Carlos Garnacho
c6b2e47931 Let gtk_widget_get_path() correct early calls during init(). 2010-12-04 15:39:40 +01:00
Carlos Garnacho
ebd8463007 GtkCssProvider: Handle unfocused label selections in default CSS. 2010-12-04 15:39:40 +01:00
Carlos Garnacho
90dd2eb42b GtkLabel: Use style context for rendering. 2010-12-04 15:39:40 +01:00
Carlos Garnacho
0fce9342ef GtkThemingEngine: Draw 3D-like effects on square frames with lines. 2010-12-04 15:39:40 +01:00
Carlos Garnacho
3138cc7677 GtkThemingEngine: Render rounded frames with light/shadow connections at 45° 2010-12-04 15:39:39 +01:00
Carlos Garnacho
95ae1a0aa6 GtkThemingEngine: don't overshoot when rendering frames. 2010-12-04 15:39:39 +01:00
Carlos Garnacho
e47c8e2490 GtkStyle: Return the default icon set if no context is attached. 2010-12-04 15:39:39 +01:00
Carlos Garnacho
5d496aa7f3 GtkStyle: Do not warn if attach count == 0
This is going go happen more and more often now, as realize handlers start
removing the gtk_widget_style_attach() calls.
2010-12-04 15:39:39 +01:00
Carlos Garnacho
6bf04fbd94 GtkCssProvider: Add a default border color for insensitive elements. 2010-12-04 15:39:39 +01:00
Matthias Clasen
e57e0e978d Illustrate extension rendering 2010-12-04 15:39:39 +01:00
Matthias Clasen
8589c5c65e Add slider illustration 2010-12-04 15:39:38 +01:00
Matthias Clasen
7e96a51953 Add examples for frame rendering 2010-12-04 15:39:38 +01:00
Matthias Clasen
4c04d944e8 Atempt to fix stretched 9slice rendering 2010-12-04 15:39:38 +01:00
Matthias Clasen
30fe448750 Fix handling of junctions in frame drawing code 2010-12-04 15:39:38 +01:00
Matthias Clasen
e522381183 Add a background example to the docs 2010-12-04 15:39:38 +01:00
Matthias Clasen
d532c0e5c2 Test some wilder names for classes, etc 2010-12-04 15:39:37 +01:00
Matthias Clasen
391e445d11 Allow digits in selectors and values, where appropriate 2010-12-04 15:39:37 +01:00
Matthias Clasen
f13f315312 Some more images for gtk_render docs 2010-12-04 15:39:37 +01:00
Matthias Clasen
d4c70f214d Declare transition and border-image properties to be writeonly
We don't make the types of their values public, so getting their
values is useless and will leak.
2010-12-04 15:39:37 +01:00
Matthias Clasen
a5e10e9b26 Improve some gtk_render_ docs
With pictures !!
2010-12-04 15:39:36 +01:00
Matthias Clasen
d7a0fe5bf1 Document predefined style provider priorites
Also, rename GTK_STYLE_PROVIDER_PRIORITY_DEFAULT to _THEME and
use it for themes.
2010-12-04 15:39:35 +01:00
Matthias Clasen
a260059c7f Fix doc formatting 2010-12-04 15:39:35 +01:00
Matthias Clasen
d9b0da5b83 Fix resize grip drawing
There was some confusion about junctions...
2010-12-04 15:39:34 +01:00
Matthias Clasen
be0ed14cce Fix GtkRadioButton drawing 2010-12-04 15:39:34 +01:00
Matthias Clasen
fc10599ac8 Make unfocused selections visible in entries 2010-12-04 15:39:33 +01:00
Matthias Clasen
21a193ad02 Make expanders prelight 2010-12-04 15:39:33 +01:00
Matthias Clasen
8b6112b6e0 Rewrite GtkInfoBar color handling to bypass GtkStyle
This avoids a segfault that was happening due to the recursion
detection not working anymore with the old way of doing things.
2010-12-04 15:39:33 +01:00
Carlos Garnacho
d63615d9cc GtkCssProvider: Render inconsistent toggle buttons differently. 2010-12-04 15:39:32 +01:00
Carlos Garnacho
9b2f878b06 GtkCssProvider: do not use selected fg/bg in sliders or spinbutton buttons. 2010-12-04 15:39:32 +01:00
Carlos Garnacho
bcf1ee4825 GtkCssProvider: Use 1px border width for spinbutton buttons. 2010-12-04 15:39:32 +01:00
Carlos Garnacho
74b032b816 GtkCssProvider: Render radio and check boxes framess in menus. 2010-12-04 15:39:32 +01:00
Carlos Garnacho
b33d48a802 GtkCssProvider: use selected fg/bg for selected menu items in CSS. 2010-12-04 15:39:31 +01:00
Carlos Garnacho
85aa672ff7 GtkCssProvider: Draw frame around menubars and toolbars in default CSS. 2010-12-04 15:39:31 +01:00
Matthias Clasen
fea567bb9f More documentation reshuffling 2010-12-04 15:39:31 +01:00
Matthias Clasen
ace967a042 Tweak wording 2010-12-04 15:39:30 +01:00
Matthias Clasen
3a7f79e814 Document border images better 2010-12-04 15:39:30 +01:00
Matthias Clasen
953ac51fb8 Make url parsing work for slices
The border-image parsing code relies on parse_path_str to return
a meaningful end_ptr in case of success, too.
2010-12-04 15:39:29 +01:00
Matthias Clasen
28e549082c Fix Gtk9Slice creation 2010-12-04 15:39:29 +01:00
Matthias Clasen
69254c552a Allow / in values
Otherwise, using url(path) on the right-hand side of properties
is not going to work.
2010-12-04 15:39:28 +01:00
Matthias Clasen
7d6fb7b7e7 Add some images to the docs
Add graphs for the transition functions and gradient examples.
2010-12-04 15:39:28 +01:00
Matthias Clasen
b2d338d370 GtkWidgetPath documentation tweaks 2010-12-04 15:39:27 +01:00
Matthias Clasen
077270142f GtkStyleContext documentation tweaks 2010-12-04 15:39:27 +01:00
Matthias Clasen
bcf3de095f Document various style-related enums 2010-12-04 15:39:26 +01:00
Carlos Garnacho
11480c57f0 GtkStyleContext: Use correct type for animation duration. 2010-12-04 15:39:26 +01:00
Carlos Garnacho
32ccac94e0 GtkAnimationDescription: parse "loop" correctly.
This sscanf parsing needs to go...
2010-12-04 15:39:25 +01:00
Carlos Garnacho
0c1cfd8a34 GtkStyle: handle scales when translating the detail string. 2010-12-04 15:39:24 +01:00
Carlos Garnacho
71f187a84f GtkCssProvider: Handle progressbars. 2010-12-04 15:39:24 +01:00
Carlos Garnacho
f3445a2430 GtkCssProvider: Do not have border-color the same than active bg-color. 2010-12-04 15:39:24 +01:00
Carlos Garnacho
171157b0e4 GtkMenu: Use GtkStyleContext for rendering. 2010-12-04 15:39:23 +01:00
Carlos Garnacho
6fff76568c GtkMenuBar: Use GtkStyleContext for rendering. 2010-12-04 15:39:23 +01:00
Carlos Garnacho
0df9c70200 Use gtk_render_activity() when rendering progressbars through GtkStyle 2010-12-04 15:39:23 +01:00
Carlos Garnacho
ee37847952 GtkCssProvider: Use default value when handling "none".
This way the default value has a way to override other values in previous
GtkStyleProviders when merged.
2010-12-04 15:39:22 +01:00
Matthias Clasen
5e26fb75a0 Add GtkStyleProperties to the docs 2010-12-04 15:39:22 +01:00
Matthias Clasen
e2f91f7201 Documentation improvements
This patch adds more detail to the explanation of CSS, and also
adds documentation about which files are read.

We also make :focus an alternative to :focused (since :focus is
a standard CSS pseudo-class).
2010-12-04 15:39:22 +01:00
Carlos Garnacho
9567ed01e8 GtkCssProvider: Base prelight foreground on bg color.
Entries are also handled, so base/text colors are used.
2010-12-04 15:39:21 +01:00
Carlos Garnacho
de94d04fea GtkCssProvider: Make prelight a bit less light in default CSS. 2010-12-04 15:39:21 +01:00
Carlos Garnacho
bc3c9ce619 GtkStyle: Fix typo.
GtkStateType was being used in gtk_style_context_get(), instead of
GtkStateFlags, oops.
2010-12-04 15:39:20 +01:00
Carlos Garnacho
ead23cd0ce GtkThemingEngine: Make render_option() depend on border-style and border-color. 2010-12-04 15:39:20 +01:00
Carlos Garnacho
be4a616e6e GtkRadioButton: Use GtkStyleContext for rendering. 2010-12-04 15:39:20 +01:00
Carlos Garnacho
756e20f58c Make "button" class depend on mode for GtkToggleButtons 2010-12-04 15:39:20 +01:00
Carlos Garnacho
84d586043e Fix checkbuttons theming in CSS so it's more similar to 2.x 2010-12-04 15:39:19 +01:00
Carlos Garnacho
7478a77b04 GtkCheckButton: Use GtkStyleContext for rendering. 2010-12-04 15:39:19 +01:00
Carlos Garnacho
04783534ed GtkThemingEngine: Make render_check() depend on border-style and border-color. 2010-12-04 15:39:19 +01:00
Carlos Garnacho
f62583d30c GtkContainer: Also copy permanent container's classes on get_path_for_child()
This makes inheritance work for the simplest cases when style is defined
for classes.
2010-12-04 15:39:18 +01:00
Carlos Garnacho
6d1cf76822 GtkWidgetPath: Make iter API deal with gints.
now gtk_widget_path_iter_* takes gints instead of guints, and also accept
numbers == -1 or > path_length for the path head.
2010-12-04 15:39:18 +01:00
Carlos Garnacho
5f88997297 GtkWidgetPath: Make gtk_widget_path_prepend_type() return nothing.
It's senseless to always return 0
2010-12-04 15:39:18 +01:00
Carlos Garnacho
198bb314c7 GtkStyleContext: preserve state on save(). 2010-12-04 15:39:18 +01:00
Carlos Garnacho
1bfb169ce6 GtkThemingEngine: Documents that engines must only use this API.
It was a bit unclear in the documentation, even if it was from the
API POV.
2010-12-04 15:39:18 +01:00
Matthias Clasen
c5b38121ec Add tests for matching
These tests try to decipher how specificity works for selectors.
2010-12-04 15:39:17 +01:00
Matthias Clasen
e1819055b9 Copy GtkWidgetPaths correctly
The code was forgetting to copy class information.
2010-12-04 15:39:17 +01:00
Matthias Clasen
49fed3d7d7 More css parsing tests 2010-12-04 15:39:17 +01:00
Matthias Clasen
4135fbf4d6 A little closer to css
Declarations are ;-separated, but there is no ; required after
the last declaration. We harmlessly accept either.
2010-12-04 15:39:17 +01:00
Matthias Clasen
933440e1f1 Some css parsing tests 2010-12-04 15:39:16 +01:00
Matthias Clasen
0396550ece Work harder at parsing import statements
Also, turn g_warning() into g_message() for now, so that tests
don't abort. Eventually, this needs to all go into GErrors.
2010-12-04 15:39:16 +01:00
Matthias Clasen
11cd19987b Move import syntax closer to css
Css allows @import url ("foo.css") or @import "foo.css" or
@import url ('foo.css') but not @import url(foo.css) or @immport foo.css.
2010-12-04 15:39:16 +01:00
Matthias Clasen
f92c352f96 Some error reporting
When we take a GError argument, better use it.
2010-12-04 15:39:16 +01:00
Matthias Clasen
5f13b65065 Fix prototype of gtk_css_style_provider_load_from_data
GError arguments must be **.
2010-12-04 15:39:16 +01:00
Matthias Clasen
72f9a7940f Add an outline around menu popups 2010-12-04 15:39:15 +01:00
Matthias Clasen
c8e5d3b07b Transform the 'menu' detail string to the 'popup' class 2010-12-04 15:39:15 +01:00
Matthias Clasen
016a656923 Fix prelighting of inconsistent radio and check buttons 2010-12-04 15:39:15 +01:00
Matthias Clasen
b6776dc116 Fix the resize handle drawing 2010-12-04 15:39:15 +01:00
Matthias Clasen
627b33265b Handle float and uint style properties
These were giving errors in testgtk.
2010-12-04 15:39:15 +01:00
Matthias Clasen
f0eafe60f8 Remove debug output 2010-12-04 15:39:14 +01:00
Matthias Clasen
4e778d7371 Fix a typo 2010-12-04 15:39:14 +01:00
Matthias Clasen
512bc44dbc Make frames visible by default 2010-12-04 15:39:14 +01:00
Matthias Clasen
9ca66efe2c Fix a memory leak 2010-12-04 15:39:14 +01:00
Matthias Clasen
69f91fed94 Translate detail strings for radio buttons 2010-12-04 15:39:14 +01:00
Carlos Garnacho
25b6945971 GtkThemingEngine: remove unused code 2010-12-04 15:39:13 +01:00
Carlos Garnacho
892fe46324 Fix compile warnings 2010-12-04 15:39:13 +01:00
Carlos Garnacho
c9dc09e980 GtkStyleProvider: Pass a GParamSpec in get_style_property().
This is so we can know the owner type of the property, and matching
with the stored strings in GtkCssProvider is direct.
2010-12-04 15:39:13 +01:00
Carlos Garnacho
b613f1f1f2 GtkStyleContext: Also use screen providers for widget style properties. 2010-12-04 15:39:13 +01:00
Carlos Garnacho
13e186bbca Handle menuitem detail string better. 2010-12-04 15:39:13 +01:00
Carlos Garnacho
9a2d1e5433 GtkSettings: install theme CSS with a lower priority.
This is so GtkSettings has an opportunity to modify theme colors.
2010-12-04 15:39:12 +01:00
Carlos Garnacho
0057aa5445 Add corners to GtkJunctionSides, defining sides as 2 corners. 2010-12-04 15:39:12 +01:00
Matthias Clasen
eb8a1c4e33 Don't whine about expander-style missing
This check was lost in the GtkStyleContext porting.
2010-12-04 15:39:12 +01:00
Carlos Garnacho
43cff6f6f7 GtkCssProvider: theme notebooks. 2010-12-04 15:39:11 +01:00
Carlos Garnacho
6099399fa7 GtkThemingEngine: Use border settings on render_extension/frame_gap() 2010-12-04 15:39:11 +01:00
Carlos Garnacho
60a2e90df7 GtkStyle: transform tabs' detail string. 2010-12-04 15:39:10 +01:00
Carlos Garnacho
534942d994 GtkThemingEngine: Do not use possible reserved word. 2010-12-04 15:39:10 +01:00
Carlos Garnacho
d4aade109f Fix gtk_css_provider_get_named() docs. 2010-12-04 15:39:09 +01:00
Carlos Garnacho
c37797a10c GtkSettings: Keep right refcount of the theme provider. 2010-12-04 15:39:08 +01:00
Carlos Garnacho
611cb007b4 GtkSettings: Ensure the theme CSS is loaded on startup. 2010-12-04 15:39:08 +01:00
Carlos Garnacho
8243c3c025 GtkCssProvider: Fix typo in gtk_css_provider_get_named()
provider was being redefined in the inner block, so the loaded
provider didn't get to be returned.
2010-12-04 15:39:08 +01:00
Carlos Garnacho
a185954d7c Hardcode 3.0 version for style files and paths.
It's about time to start using the right paths.
2010-12-04 15:39:07 +01:00