Commit Graph

27863 Commits

Author SHA1 Message Date
Daniel Boles
90b9dc458f combobox: Stop pointlessly NULL-checking the menu
We now have a valid menu to use at all times.
2017-01-21 21:34:46 +00:00
Daniel Boles
8c980445e3 combobox: Move area and menu to .ui file
Now that priv->area is guaranteed to be constructed by us, and not
passed in by a user, we can move it to the .ui file and stop manually
managing its lifetime altogether. And once the area is there, we can
move the menu there too (and stop pointlessly destroying/rebuilding it).
2017-01-21 21:34:46 +00:00
Daniel Boles
439fcf7578 combobox: Remove property cell-area
The CellArea is going to become a pure implementation detail & be moved
to the .ui, instead of letting users mess with it (if anyone ever did).
2017-01-21 21:34:45 +00:00
Daniel Boles
36413a8eca combobox: Reuse code rather than reimplementing it
We already have cell_layout_is_sensitive() to get whether at least one
cell in a Layout is sensitive, which we need because CellLayout/View
do not implement foreach(). So, since we wrote that, we can use it to
check our CellArea too, instead of doing foreach with a custom callback.
2017-01-21 19:00:10 +00:00
Daniel Boles
c7e4c82df4 combobox: some code cleanups
* Merge adjacent if statements with the same condition
 * Add a space between a function and its declaration
2017-01-21 18:59:27 +00:00
Daniel Boles
c5c0127e10 menushell: Fix select_last() to get last, not 1st
It was broken in the same way as select_first(), as explained in
commit a5211adb22
2017-01-21 18:55:46 +00:00
Daniel Boles
c662e691ed combobox: Fix documentation typo bx => box 2017-01-21 16:13:44 +00:00
Daniel Boles
a5211adb22 menushell: Make select_first() do that, not last…
It was looping over all items, not breaking out when it found the first
selectable one, and then selecting the _last_ selectable one (if any)
found. So, it did exactly the opposite of its name. This made me quite
baffled when opening a submenu with right-arrow put me at its last item.

Originally, the loop set to_select and broke if the current item was
selectable and not tear-off, meaning that it would correctly select the
first suitable item. However, when tear-off functionality was removed
in commit 4ed9452e90, so was the break.
2017-01-21 15:50:54 +00:00
Piotr Drąg
e47bd31e6a Fix CSS spelling in a translatable string 2017-01-20 23:46:38 +01:00
Daniel Boles
71d7a1b3d0 menushell: Don’t dereference before typechecking 2017-01-20 22:15:42 +00:00
Daniel Boles
802f838aa0 combobox: If typechecking, don’t reference before 2017-01-20 21:08:58 +00:00
Timm Bäder
ab051fd53f Don't hide windows and popovers in init()
Instead, don't make them visible in gtk_widget_init in the first place.
2017-01-20 21:51:05 +01:00
Timm Bäder
b1408c9694 fontbutton: Be a GtkWidget 2017-01-20 21:51:03 +01:00
Timm Bäder
6376aaf44b assistant: Don't forget to remove child widgets 2017-01-20 21:50:02 +01:00
Timm Bäder
0f2e043c3d toolitemgroup: Properly remove internal child widget
We now need to use gtk_widget_unparent and can't just destroy it.
2017-01-20 21:50:02 +01:00
Timm Bäder
4bd2a9bca9 popovermenu: Remove forall implementation 2017-01-20 21:50:02 +01:00
Timm Bäder
3fb4b079e1 button: Don't explicitly show child widgets 2017-01-20 21:50:02 +01:00
Timm Bäder
c36ad400fa recorder: Adapt to widget visibility changes
We now need to explicitly hide the details label.
2017-01-20 21:50:02 +01:00
Timm Bäder
3ec15d98fa Fix some widget visibility fallout 2017-01-20 21:37:08 +01:00
Timm Bäder
f4341ee9f7 widget: Remove show-all property
Doesn't make sense anymore now that gtk_widget_show_all is gone.
2017-01-20 21:37:07 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Timm Bäder
13b001b77c widget: Remove show_all vfunc 2017-01-20 21:33:38 +01:00
Timm Bäder
5f57e3b711 filechooserbutton: Be a GtkWidget
Instead of subclassing GtkBox to have 2 child widgets, subclass
GtkWidget and only render one of them.
2017-01-20 21:33:38 +01:00
Timm Bäder
d862c5c6df sizerequest: Use gtk_widget_measure to measure widget sizes 2017-01-20 21:33:38 +01:00
Timm Bäder
9679c4f0e0 gtkbuilder: Improve error messages 2017-01-20 21:33:37 +01:00
Timm Bäder
2a84be4ae5 shortcutswindow: Unset search_bar in dispose
And check for null-ness in unmap. This prevents a crash when the window
is first disposed and then unmapped.
2017-01-20 21:33:37 +01:00
Timm Bäder
5dbf8458f5 shortcutswindow: Use GtkButton:icon-name for search button 2017-01-20 21:33:37 +01:00
Timm Bäder
524bf22db7 shortcutsshortcut: Be a GtkWidget
Instead of subclassing GtkBox and overriding _add to not work, subclass
GtkWidget and add a normal GtkBox as a child widget.
2017-01-20 21:33:37 +01:00
Timm Bäder
8085884277 gtkshortcutswindow: Adapt to GtkWidget visibility changes 2017-01-20 21:33:37 +01:00
Timm Bäder
02c2887772 filechooser: adapt to GtkWidget:visible changes 2017-01-20 21:33:37 +01:00
Timm Bäder
b1eccd770e coloreditor: Hide overlay boxes 2017-01-20 21:33:37 +01:00
Timm Bäder
33d41fccdd Hide popovers and toplevels by default 2017-01-20 21:33:37 +01:00
Timm Bäder
fee788cd4a widget: Be visible by default 2017-01-20 21:33:36 +01:00
Daniel Boles
360fbd0920 combobox: popdown() the menu during unmap()
combo_box_popdown() currently skips popping down our menu if it is NULL.
But the required call to this at end-of-life was in destroy(), by which
point dispose() already NULLed the menu, so Menu::popdown() would never
run, even if it should. Fix this by trying popdown() earlier in unmap().
Also, add a converse assurance that we don’t popup() while not mapped.

Even once we remove all the now-pointless NULL checks, destroy() was the
wrong place to call combo_box_popdown(), and unmap() is the right place.
2017-01-20 13:47:26 +00:00
Chun-wei Fan
3629def0d0 gtkmain: Fix build on Windows
gtk_init() removed its support for supporting arguments, so we ought to do
likewise for Windows, which actually defines items that call gtk_init()
the old way (and also get rid of argument support in those functions,
since the direction is to not support them).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-01-20 19:50:02 +08:00
Benjamin Otte
f8b6831c98 gtk: Register GSK resources at startup
That way they show up in the resource list in the inspector even when
running with the Cairo renderer.
2017-01-20 01:19:02 +01:00
Daniel Boles
68824e80fd combobox: Remove dead code & unneeded type checks
Commit fdc0c6426b removed the appears-as-
list style property, & hence the ability to put the ComboBox into list
mode – but it left behind a pile of hijinks that were only used in said
mode & so were now doing absolutely nothing. This commit deletes those.

While doing that, I got carried away…so this also stops pointlessly type
checking popup_widget, as that can never be anything but a GtkTreeMenu.
It still checks for NULL everywhere, which shouldn’t be needed, but (A)
this commit is already too big, & (B) simply removing such checks where
they _seem_ unnecessary causes bad times. I’ll puzzle through that later
2017-01-19 23:50:09 +00:00
Daniel Boles
c790724469 combobox: Make wrap-width and grid mode work again
Commit fdc0c6426b for removing (partly!)
appears-as-list also deleted the code that propagated wrap-width to the
TreeMenu and thus put us into “grid mode”. This restores that code.

And as Benjamin noted, calling check_appearance() here is wrong, so bye.
2017-01-19 22:08:45 +00:00
Matthias Clasen
2c7e567f05 Update callers
Adapt all our tests and examples to the new initialization api.
2017-01-19 13:50:17 -05:00
Matthias Clasen
7a13715736 Drop arguments from gtk_init
This is our ultimate goal: no more commandline argument handling.
Lots of callers will have to be updated.
2017-01-19 13:21:12 -05:00
Matthias Clasen
f2ee897009 Simplify initialization code
Now that gtk_get_option_group and gtk_parse_args are no longer
public, we can get rid of them.
2017-01-19 13:21:12 -05:00
Matthias Clasen
64b40c65ae Drop the --gtk-debug and --gtk-no-debug options
We have environment variables that cover this.
2017-01-19 13:21:12 -05:00
Matthias Clasen
4cfcca7997 Drop the --g-fatal-warnings argument
We don't need it, GLib has an environment variable for this.
2017-01-19 13:21:12 -05:00
Matthias Clasen
9c52f6b3ca Drop the --gtk-modules argument
We don't need it; the environment variable is enough.
2017-01-19 13:21:12 -05:00
Matthias Clasen
63d6e2d8e2 Don't export gtk_get_option_group
We want to get rid of commandline option handling in GTK+.
This is a step in that direction.
2017-01-19 13:21:12 -05:00
Matthias Clasen
42fd5a0b8b Stop exporting gtk_parse_args
We want to stop handling commandline arguments, and that is the
sole purpose of this function. So it has to go
2017-01-19 13:21:12 -05:00
Matthias Clasen
7e8eb3ddcd Drop gtk_init_with_args
We want to simplify our initialization code and remove all commandline
argument handling from it. The first stop for this is to reduce the
number of gtk_init variants we have.
2017-01-19 13:21:12 -05:00
Daniel Boles
94ae322f65 combobox: Avoid a pointless assignment
Don’t get the active item pointer before the grid/non-grid conditional,
because if we’re in grid mode, we re-get it before selecting it anyway.
2017-01-19 03:31:52 +00:00
Daniel Boles
c83ead5eea combobox: Also preselect active item in grid popup
i.e. when wrap-width > 0. This was only being done for non-grid cases.
So, ComboBoxes in grid mode did not indicate their selection when popped
up and required users to keynav from ‘nothing’ (at the top-left) to the
item they wanted to select. By selecting the active item in advance, now
it’s highlighted & acts as the starting point for keynav around the grid
2017-01-19 03:18:08 +00:00
Daniel Boles
494a38504b scale: Really fix documentation of set_digits()
This previously only mentioned its effect on the displayed value, and
even after the previous commit, its rounding of the actual value upon
change still reads like too much of an afterthought. Worse, it wasn’t
mentioned at all in the doc for the @digits parameter. Change this to
emphasise rounding always occurs and the displayed value is secondary.
2017-01-19 00:45:32 +00:00