Replaced the deprecated GTK color-selector (`gtk_color_selection_dialog_new`) with the GTK color-chooser (`gtk_color_chooser_dialog_new`). You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2340
-- Commit Summary --
* Update tools.c
-- File Changes --
M src/tools.c (35)
-- Patch Links --
https://github.com/geany/geany/pull/2340.patch https://github.com/geany/geany/pull/2340.diff
@DevynCJohnson pushed 1 commit.
1f2de446e671224b197d73a15f8ba56054325306 Update tools.c
@DevynCJohnson pushed 1 commit.
917f742304911eec176d916a0f9b31b333a862e9 Update tools.c
LarsGit223 requested changes on this pull request.
The gtk version checks are not correct. This will break on systems between gtk version 3.0 and 3.4.
@@ -828,20 +842,27 @@ void tools_color_chooser(const gchar *color)
if (ui_widgets.open_colorsel == NULL) { +#if (gtk_major_version == 3) + ui_widgets.open_colorsel = gtk_color_chooser_dialog_new(_("Color Chooser"), GTK_WINDOW(main_widgets.window));
```gtk_color_chooser_dialog_new()``` requires at least gtk version 3.4 not 3. You could use ```#if GTK_CHECK_VERSION(3, 4, 0) ... else ... endif``` for a correct version check.
GeanyDocument *doc = document_get_current();
+ g_return_if_fail(doc != NULL); +#if (gtk_major_version == 3) + GdkRGBA color; + char hex[8] = { 0 }; + + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(ui_widgets.open_colorsel), &color); + sprintf(hex, "#%02X%02X%02X",
This requires version 3.4 not 3.
@DevynCJohnson pushed 1 commit.
fdf741f5d6ee8bd4f13e49fa54534dc27365422e Update tools.c
@DevynCJohnson pushed 1 commit.
7931a5d3ba8240a5dc2d3f598754cf2aa3f8965b Update tools.c
github-comments@lists.geany.org