Commit Graph

25814 Commits

Author SHA1 Message Date
Benjamin Otte
99153ed585 win32: Remove XP-specific code
We don't support XP anymore.
2016-02-11 03:44:48 +01:00
Benjamin Otte
a620a1d688 win32: Remove unused functions / header includes 2016-02-11 03:44:48 +01:00
Benjamin Otte
9efb275a13 filechoosernativewin32: Remove unused variables 2016-02-11 03:44:47 +01:00
Benjamin Otte
dda959332f imcontextsimple: Remove unused variable on win32 2016-02-11 03:44:47 +01:00
Benjamin Otte
ce8a98e21b win32 theme: Get rid of deprecated style properties
That's pretty easy, because we can just delete them. The theme is broken either way.
2016-02-11 03:44:47 +01:00
Benjamin Otte
9c700b2bc6 win32 theme: Replace pseudoclasses with undeprecated ones 2016-02-11 03:44:47 +01:00
Benjamin Otte
93ecb1d187 win32 theme: Do a quick'n'dirty search/replace
Try to replace the old style names with then new style names.

The theme is still entirely way too broken. But at least one can see something.
2016-02-11 03:44:47 +01:00
Benjamin Otte
76e56c5038 win32: Stop using _gdk_display global in device code
Use gdk_device_get_display() instead.
2016-02-11 03:44:47 +01:00
Benjamin Otte
ccbfa64d67 win32embedwidget: Mark deprecated sections 2016-02-11 03:44:47 +01:00
Benjamin Otte
ccc7e3058c filechoosernativewin32: Silence gcc 2016-02-11 03:44:47 +01:00
Benjamin Otte
068f8a3da1 filechoosernativewin32: Add missing return type
Looks like a line accidentally was deleted there.
2016-02-11 03:44:47 +01:00
Benjamin Otte
117e303b44 filechoosernativewin32: Define MSC_VER at top of file
The headers we include might include windows headers which define _MSC_VER already.
2016-02-11 03:44:47 +01:00
Benjamin Otte
0ea9131ff7 printoperation-win32: Silence gcc 2016-02-11 03:44:47 +01:00
Benjamin Otte
573f51cb29 mountoperation: Silence gcc
Also, printf()ing a GPid should be forbidden.
2016-02-11 03:44:47 +01:00
Benjamin Otte
1d980192fa immodule: Stop gcc from complaining 2016-02-11 03:44:47 +01:00
Timm Bäder
becfd18b07 overlay: set css name 2016-02-10 14:03:56 +01:00
Timm Bäder
bdd182f38c frame: Set border gadget state after creating it 2016-02-10 14:03:39 +01:00
Timm Bäder
c44364f1d1 spinbutton: Free the gadget in finalize 2016-02-10 12:30:35 +01:00
Timm Bäder
8ea573b473 css node tree: Fix crash
This function would return "" whenever the state of the css node was
unset, causing a crash when selecting the css node tree from the
sidebar.
2016-02-10 12:28:32 +01:00
Matthias Clasen
a3a5cf1087 text view: Improve tag pointer tracking
A problem that has been observed in polari is that links in tags
are clickable all the way into the margin. This problem is caused
by gtk_text_view_get_iter_at_position ignoring the return value
of pango_layout_xy_to_index. Instead, pass it back as a boolean
return value. This is technically an API break, but we've allowed
ourselves to change return types from void to gboolean before.
2016-02-10 00:01:54 -05:00
Rui Matos
019dab7c38 gtkmagnifier: Avoid a crash if the inspected widget is finalized
If the inspected widget is finalized and we then try to disconnect
from its signals we'll crash.

https://bugzilla.gnome.org/show_bug.cgi?id=761775
2016-02-09 15:35:17 +01:00
Timm Bäder
1331b60029 A few more documentation fixes 2016-02-09 08:05:16 +01:00
Timm Bäder
c5369356e8 Various documentation fixes
Always have Since: annotations at the very bottom, use the correct
ClassName::signal-name/ClassName:property-name syntax, fix a few typos
in type names, wrong function names, non-existing type names, etc.
2016-02-08 22:56:52 +01:00
Rico Tzschichholz
76fedc1882 gtk: Fix some return-values annotations (transfer none/full) 2016-02-08 14:03:55 +01:00
Matthias Clasen
dc407dbc8f inspector: Avoid crash in magnifier
We can't use gtk_widget_draw on widgets that are not allocated.
2016-02-08 09:34:24 +01:00
Timm Bäder
486a0a467d image: _get_style_context never returns NULL 2016-02-07 19:16:26 +01:00
Timm Bäder
ded745a4b9 Make gtk_icon_helper_invalidate private 2016-02-07 19:16:26 +01:00
Timm Bäder
0bd6c48315 Add and use gtk_icon_helper_invalidate_for_change 2016-02-07 19:16:26 +01:00
Timm Bäder
0c80210685 iconhelper: Save whether the surface is symbolic 2016-02-07 19:16:26 +01:00
Timm Bäder
0ec4c76d8f stylepropertyimpl: Use GTK_CSS_AFFECTS_SYMBOLIC_ICON
Things like color affect symbolic icons, but not colored icons, while
other css properties like -gtk-icon-effect affect colored icons, but not
symbolic ones.
2016-02-07 19:16:26 +01:00
Timm Bäder
2d8db26cbf csstypes: Add GTK_CSS_AFFECTS_SYMBOLIC_ICON 2016-02-07 19:16:26 +01:00
Timm Bäder
d3a0dfe81a cssstylechange: Add helper function to print change
So I don't have to print both styles to the console, paste them both
into a file and then run diff on the 2 files anymore.
2016-02-07 19:16:26 +01:00
Timm Bäder
2902063f24 iconhelper: Un-duplicate some code 2016-02-07 19:16:26 +01:00
Timm Bäder
c360b5fb49 Remove more unnecessary redraws
The call to gtk_widget_set_state_flags immediately before these already
queues a redraw/allocate/resize in case they have to be queued.
2016-02-07 19:16:26 +01:00
Matthias Clasen
667069cff2 Adwaita: No rounded corners for fullscreen
If the theme has rounded corners for fullscreen, we don't tell the
window manager that we are now fully opaque, which then makes things
less efficient than they should be.

https://bugzilla.gnome.org//show_bug.cgi?id=761571
2016-02-07 18:00:29 +01:00
Matthias Clasen
af64a60466 box gadget: Fix allocation without baseline
When we don't get a baseline passed in, we want to basically
center the children inside the allocation. There was an attempt
in the code to do 'internal baseline alignment', but it had the
side effect of moving the contents to the top when we don't get
a baseline passed in. Remove it for now, this needs some more
infrastructure to do properly.

https://bugzilla.gnome.org/show_bug.cgi?id=761363
2016-02-07 15:08:56 +01:00
Matthias Clasen
c3c01d8cbc level bar: Document buildable syntax 2016-02-07 11:43:13 +01:00
Matthias Clasen
ccd8c76ff2 level bar: Fix offset behavior
We had some odd special-casing for the lowest and highest offset
that did not quite work. The new rule is simple: If the value
is between offset n-1 and n, it gets the style for offset n.

https://bugzilla.gnome.org/show_bug.cgi?id=761416
2016-02-06 16:43:45 +01:00
Matthias Clasen
1a71579b61 level bar: Improve documentation
The docs were not explaining at all what happens to existing
level offsets when the min- or max-value of a level bar are
changed.
2016-02-06 16:19:13 +01:00
Matthias Clasen
8776bb5324 level bar: Make the full offset official
We are adding 3 offsets, not just two. Add a define for the
third one, and mention it in the docs.
2016-02-06 16:11:17 +01:00
Benjamin Otte
d48d3b359c cssselector: Remove type references
We don't use types anymore.
2016-02-05 23:47:48 +01:00
Benjamin Otte
e8fca5bbbe cssmatcher: Remove type argument from name matcher
We no longer use types when matching names.
2016-02-05 23:43:05 +01:00
Benjamin Otte
fe6d4cbdf5 inspector: Drop type name from node list
It's not used anymore in the CSS, so people don't need to see it.
2016-02-05 19:31:47 +01:00
Benjamin Otte
0c12601208 cssimageradial: Only allow at "<position>" after other props
Don't allow syntax like
  at top left circle
but follow the spec about requiring the at <position> right before the
comma.

This is porbably because
  circle at 10px 10px
could be interpreted as
  circle 10px at 10px
with the now disallowed syntax, too.

Test included.
2016-02-05 19:31:47 +01:00
Benjamin Otte
982da040b2 cssimageradial: Only emit one error for wrong position
Test included.
2016-02-05 19:31:47 +01:00
Benjamin Otte
5444442974 css: Convert numbers with GTK's dpi
Don't hardcode 96 for dpi, but instead use the value of the -gtk-dpi
property (that mirrors the GdkScreen's dpi if it wasn't set explicitly).

This makes these values scale when the large font setting in
control-center is enabled.
2016-02-05 14:52:09 +01:00
Benjamin Otte
e35e6abbb2 css: Properly convert em, ex and rem to pixels
The previous code converted to pt.
2016-02-05 14:52:09 +01:00
Lapo Calamandrei
56b1b08bb8 Adwaita: darker background for popovers 2016-02-05 14:11:30 +01:00
Matthias Clasen
61307deaf7 levelbar: Make discrete levelbars behave as before
During the gadget conversion, the drawing of discrete levelbars
was unintentionally changed to draw a wide trough but narrow
blocks, which does not look great. So go back to the previous
way of drawing things.

https://bugzilla.gnome.org/show_bug.cgi?id=761428
2016-02-05 11:53:50 +01:00
Matthias Clasen
339023dee5 Fix indentation
gcc 6 complains about this.
2016-02-05 11:42:28 +01:00
Timm Bäder
680ec087ab switch: Don't queue draws after setting state flags 2016-02-04 20:00:21 +01:00
Benjamin Otte
0e7691c12e css: Add rem unit
Good luck, Lapo.
2016-02-04 19:37:44 +01:00
Benjamin Otte
f7ec9c98ef widget: Set a css name
Now selecting a widget by class name no longer works.

This is probably most relevant for users outside of GTK that want to
style their own widgets. Those widgets should now either add their own
style classes (if they want to adjust existing CSS) or use
gtk_widget_class_set_css_name() themselves (if they want to get rid of
all "upstream" styling).
2016-02-04 17:27:03 +01:00
Timm Bäder
35cd0be468 Range: Group all three gestures
And reset the grab_location in the ::released handler of the multipress
gesture.

Previously, when leaving fine-tune mode, the ::released handler of the
multipress gesture would call stop_scrolling, which calls
range_grab_remove and resets the grab_location. The ::drag-end handler
is executed after that, and only unsets priv->in_drag if the
grab_location is MOUSE_OUTSIDE, which it never was, since the ::released
handler already reset it. This lead to priv->in_drag being set even
though no dragging was in progress anymore, which e.g. made shift
pressed after leaving the fine-tune mode entering it again.

https://bugzilla.gnome.org/show_bug.cgi?id=761402
2016-02-04 17:08:30 +01:00
Руслан Ижбулатов
4a49d8d14f Don't do remote checks on NULL files
Calling _gtk_file_consider_as_remote() with a NULL argument
results in warnings being thrown.

Note that query->priv->location being NULL is a state that does
not seem to be invalid by itself.

This could happen if you do search-as-you-type in a filechooser,
which has a filter that does not match anything *and* the current
"place" selected is "Recent".

https://bugzilla.gnome.org/show_bug.cgi?id=761552
2016-02-04 15:57:35 +00:00
Matthias Clasen
3756d92367 Move private widget path functions away
We don't put private functions in public headers anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=761339
2016-02-04 15:19:51 +01:00
Benjamin Otte
8d515409c6 win32: Get rid of XP theme
XP is not supported anymore. And we can massively simplify the win32
theme if we don't have to support 2 versions.
2016-02-04 14:25:46 +01:00
Benjamin Otte
7d4bf49cff win32: Delete classic theme
Well, actually, stop adding an extra version of raleigh
2016-02-04 14:23:08 +01:00
Benjamin Otte
27901c7794 build: Don't break windows build
Hardcode the existing files instead of doing a for loop and attempting
string-fudging magic.
2016-02-04 14:19:51 +01:00
Lapo Calamandrei
6cdca1e124 Adwaita: removed some old cruft from _drawing.scss
resulting in a nice number of non working selectors ditched.
2016-02-04 14:14:59 +01:00
Benjamin Otte
b783670820 inspector: Don't hardcode builtin themes
Insteead, enumerate the resources that are available. Fixes windows
themes not being listed in the inspector.
2016-02-04 13:35:21 +01:00
Benjamin Otte
d0fd7990c3 cssprovider: Change location of builtin themes
Instead of
  /org/gtk/libgtk/theme/$THEME-$VARIANT.css
look at
  /org/gtk/libgtk/theme/$THEME/gtk-$VARIANT.css
and that way mirror the directory layout of real themes.
2016-02-04 13:35:21 +01:00
Timm Bäder
6bc096d748 actionbar: Remove unnecessary map/unmap implementations
These just do what the default implementations do anyway.
2016-02-04 13:32:34 +01:00
Timm Bäder
641e703882 statusbar: Remove unused include 2016-02-04 13:32:34 +01:00
Timm Bäder
572e9a0402 Remove _gtk_box_get_children
It's doing exactly the same thing as gtk_container_get_children.
2016-02-04 13:32:34 +01:00
Timm Bäder
2929621d05 colorswatch: Remove unused constant 2016-02-04 13:32:34 +01:00
Benjamin Otte
c95087c70a entry: queue an allocate when pulsing
We need to reposition the progress gadget and that's done during
allocation.
2016-02-04 12:25:13 +01:00
Alberts Muktupāvels
7ac337a9af gtksettings: fix critical warning
Commit 5186aeb90f introduced critical
warning - g_value_copy: assertion 'g_value_type_compatible (...)' failed.

https://bugzilla.gnome.org/show_bug.cgi?id=761381
2016-02-04 11:45:50 +02:00
Benjamin Otte
9708ecdd5b composetable: Fix gcc warnings 2016-02-03 23:06:53 +01:00
Benjamin Otte
be6f65a08e immodule: Use correct sign for function prototype 2016-02-03 22:53:22 +01:00
Benjamin Otte
429bec54e5 entry: Turn progress node into a gadget 2016-02-03 22:53:22 +01:00
Benjamin Otte
3316d69abb entry: Simplify drawing code 2016-02-03 22:53:22 +01:00
Lapo Calamandrei
207a842bfd Adwaita: fix headerbar spinbutton size
fixes https://bugzilla.gnome.org/show_bug.cgi?id=761484
2016-02-03 18:32:51 +01:00
Matthias Clasen
0bcd8603eb print dialog: Fix layout preview drawing
Use the CSS name paper for this as well, and make sure Adwaita
sets a color that makes the text visible in the dark theme as well.
2016-02-03 16:07:51 +01:00
Lapo Calamandrei
a0363e5f0a Adwaita: notebook with hidden header style fix
the stack styling is applied only when there is a header, hence
when the stack node is not the notebook only child, should cure
https://bugzilla.gnome.org/show_bug.cgi?id=760996
2016-02-03 15:23:17 +01:00
Lapo Calamandrei
f734db1604 Adwaita: fix vertical spinbutton style
correct sizing and workaround disabled entry text colors.
2016-02-03 15:03:39 +01:00
Carlos Garcia Campos
feabf35371 notebook: Do not reorder tabs after a grab notify if there isn't an ongoing reorder operation
This broke in f535251507 that removed
during_reorder in favor of using the current operation, but removed the
check from gtk_notebook_stop_reorder().
2016-02-02 19:02:53 +01:00
Alberts Muktupāvels
5186aeb90f gtksettings: reset property to correct default value
https://bugzilla.gnome.org/show_bug.cgi?id=76138
2016-02-02 18:15:07 +02:00
Benjamin Otte
bfb727d37e entry: Draw progress in the right place 2016-02-02 15:26:01 +01:00
Timm Bäder
6e2c551896 entry: Fix icon areas
Do the same thing we already do in gtk_entry_get_text_area.
2016-01-31 20:05:52 +01:00
Timm Bäder
033c6c82d0 widget: Annotate out params of _translate_coordinates as optional 2016-01-31 20:05:52 +01:00
Matthias Clasen
073f8bc44b gtk-builder-tool: Expand the preview command
Make the preview command parse options properly, turn the ID into
an --id=ID option, and add a --css=FILE option that allows to
specify a css file to use for previewing.

This is useful for e.g. previewing the reftest .ui files with
their corresponding .css.
2016-01-31 13:09:43 -05:00
Matthias Clasen
bc882a679d gtk-launch: Add --version
Support --version. Also improve the --help output cosmetically.
2016-01-31 12:11:58 -05:00
Matthias Clasen
836bd65408 gtk-builder-tool: Accept --help
Saying 'Failed to open file '--help' is not polite or smart.
Catch this case and show usage information.
2016-01-31 11:02:53 -05:00
Matthias Clasen
f793da54a9 file chooser: Avoid a crash
Since 39c2d12330,
priv->operation_mode == OPERATION_MODE_BROWSE no longer
guarantees that priv->browse_files_model is the current
model of the list - we are only switching the models after
loading the new directory. Avoid triggering the assertion
in show_and_select_files by checking if we have right model
before calling it.

https://bugzilla.gnome.org/show_bug.cgi?id=761209
2016-01-30 23:07:56 -05:00
Matthias Clasen
6f74de5331 Don't include the builtin sequence table in multiple places
The table is defined as static const guint16 [], so it really
should only be included in one source file.
2016-01-30 22:52:13 -05:00
Matthias Clasen
3c4f36f622 combobox: Avoid a misleading indentation
gcc 6 warns about this sort of thing. There were also some
stray ; here.
2016-01-30 22:50:54 -05:00
Matthias Clasen
7d16b8df29 treeview: Draw background when empty
We have a function we call for drawing the empty case, but
it only renders a focus rectangle. Make it draw the background
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=761309
2016-01-30 18:31:30 -05:00
Timm Bäder
16726e31f0 colorchooserwidgeet: Reset the selected swatch when removing
Otherwise, priv->current points to garbage and subsequently leads to a
crash, e.g. when adding another custom color.
2016-01-30 23:02:06 +01:00
Matthias Clasen
dd322f715f Document gtk_parse_args limitations
Mention that some things won't work without a display
connection.
2016-01-30 16:11:03 -05:00
Matthias Clasen
bbe48d0624 Throw an error when a display is missing
Creating style context won't work without a display, so
give a clear error message and abort instead of segfaulting
later on.

https://bugzilla.gnome.org/show_bug.cgi?id=761332
2016-01-30 16:06:59 -05:00
Matthias Clasen
051b6071b7 Adwaita: Add symbolic png assets
And use them as fallback for the svg ones. This lets us
avoid a hard dependency on librsvg - the theme will work
without svg support.
2016-01-30 00:29:04 -05:00
Matthias Clasen
e54549502e icontheme: Avoid a crash
gtk_icon_info_new_for_file with a size of 0 would fail for
symbolic pngs because we ended up scaling with 0. Avoid this.
2016-01-30 00:29:04 -05:00
Matthias Clasen
2e4b1e72f4 css: Support the image() notation
This lets us do fallback in case an image format is not
supported, and also lets us provide solid-color images.
We don't support image fragment notations.

See ttps://www.w3.org/TR/css3-images/#image-notation

https://bugzilla.gnome.org/show_bug.cgi?id=761318
2016-01-30 00:29:04 -05:00
Matthias Clasen
0fe468c789 Emit an error if image loading fails
Instead of spamming stderr with g_warning, use the new
emit_error method of the GtkStyleProviderPrivate interface
to emit an error if loading an image fails.
2016-01-30 00:29:04 -05:00
Matthias Clasen
2c7fdf6432 CSS provider: Add a way to emit errors
Currently, GtkCssProvider can emit ::parsing-error only during
the actual parsing, although the documentation hints that it might
happen at other times.

This commit adds a emit_error method to the GtkStyleProviderPrivate
interface that will let us emit errors from the compute() implementations
as well, which can be useful (e.g. if an image fails to load).
2016-01-30 00:29:04 -05:00
Matthias Clasen
176e85ffe5 file chooser: Make Escape close the dialog
In some situations (no header bar, save mode), hitting Escape
would not do anything because the entry ate the key event.
Fix this by telling the entry to only handle Escape when there
is something to do, such as switching back to the path bar.

https://bugzilla.gnome.org/show_bug.cgi?id=761026
2016-01-29 19:12:51 -05:00
Matthias Clasen
b281c9d740 css image recolor: Load images at the proper scale
We should not hardcode a scale of 1, this leads to
pixellated upscaled images at scale=2, even if the source
is an svg. By passing the proper scale, we can load the
svg at the correct size.
2016-01-29 17:30:10 -05:00
Matthias Clasen
001598a821 icon theme: Improve loading of unthemed files
When creating icon info objects for unthemed files, we don't
really have a nominal size, so we pass 0 to mean 'load at
original size'. However, this is not what was happening.
To make this possible, add variants of some pixbuf loading
functions that take a scale factor instead of a desired size,
and use those when we don't have a nominal size.
2016-01-29 17:27:35 -05:00
Matthias Clasen
68edc67bde image: use GtkMisc padding again
This was lost in the gadget conversion.
Thankfully, the misc-alignment reftest catches this.
2016-01-29 13:44:45 -05:00