diff --git a/INSTALL.in b/INSTALL.in
index c18b995838..c0b84f279c 100644
--- a/INSTALL.in
+++ b/INSTALL.in
@@ -18,12 +18,12 @@ GTK+ requires the following packages:
Simple install procedure
========================
- % gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
- % cd gtk+-@GTK_VERSION@ # change to the toplevel directory
- % ./configure # run the `configure' script
- % make # build GTK+
+ % tar xf gtk+-@GTK_VERSION@.tar.xz # unpack the sources
+ % cd gtk+-@GTK_VERSION@ # change to the toplevel directory
+ % ./configure # run the `configure' script
+ % make # build GTK+
[ Become root if necessary ]
- % make install # install GTK+
+ % make install # install GTK+
The Details
===========
diff --git a/NEWS b/NEWS
index ce160e142f..4bdbfebe6c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,191 @@
+Overview of Changes in GTK+ 3.6.1
+=================================
+
+* CSS:
+ - huge refactoring to avoid computing wrong values
+ - treeview: Invalidate children properly
+ - treeview: Fix computing child paths
+
+* Broadway:
+ - use binary websockets when available
+
+* Bugs fixed:
+ 646221 Imperfect Russian translation of 'Print preview'...
+ 682395 Nautilus tabs have black background
+ 684517 window: Delay showing auto mnemonics on focus in
+ 684639 GTK+ 3.5.18 makes Epiphany unusable
+ 684984 No focus rendering for Icon Views in SELECTION_N...
+ 685449 Non-uniform borders on GtkScrolledWindow break c...
+ 685996 trivial build fix: test uses = not ==
+ Fix a multi-display problem in touch handle code
+ App chooser: respect NoDisplay
+
+* Translation updates:
+ Catalan
+ Catalan (Valencian)
+ Italian
+ Japanese
+ Khmer
+ Norwegian bokmål
+ Russian
+ Slovak
+
+
+Overview of Changes in GTK+ 3.6.0
+=================================
+
+* Add support for blur to CSS shadows
+
+* Bugs fixed:
+ 679883 When printing Custom paper sizes GTK Print Dialog...
+ 684258 Crash when calling gtk_application_set_menubar twice
+ 684606 GtkMenuButton: implement rtl flipping
+ 684607 GtkSearchEntry: flip the clear icon in rtl
+ Fix style context path for internal buttons
+
+* Translation updates:
+ Bengali
+ Brazilian Portuguese
+ Bulgarian
+ Catalan
+ Catalan (Valencian)
+ Czech
+ Galician
+ German
+ Gujarati
+ Hebrew
+ Hindi
+ Kannada
+ Kyrgyz
+ Latvian
+ Malayalam
+ Punjabi
+ Russian
+ Serbian
+ Telugu
+
+
+Overview of Changes in GTK+ 3.5.18
+==================================
+
+* GMenu:
+ - Support namespaces for actions
+ - Allow submenus to have actions for opening
+ - New function: gtk_menu_shell_bind_model
+
+* CSS:
+ - Parse and support CSS animations
+ - Support cross-fading and transitions
+
+* OS X:
+ - Adjust scrollbar and scale behavior according to platform
+
+* Bugs fixed
+ 643611 Leak on gail_widget_get_description
+ 658694 GtkAssistant: Unable to change current page in prepare...
+ 670390 -GtkMenuBar-shadow-type: none disables background inst...
+ 671786 Glade XML files cannot set an ImageMenuItem accelerato...
+ 674108 Hard crash due to wrong NSAutoreleasePool stacking
+ 676890 GtkButton are still highlighted after removing them fr...
+ 677559 argument of Gdk.Keymap.map_virtual_modifiers is not co...
+ 680962 GtkMenuButton doesn't display accelerators when used w...
+ 682630 GMenuModel attribute for an action to toggle on submen...
+ 682831 gtkmodelmenu: expose API for action namespace
+ 683474 Print dialog lists custom paper sizes twice for "Print...
+ 683627 Memory leak in style_data_lookup
+ 683718 box: Fix typo
+ 683738 Simplify GtkApplicationWindow accel handling
+ 683874 Load settings.ini also from XDG_CONFIG_DIRS
+ 683896 Clean up global resources when the display is closed
+ 684038 togglebutton: always set PRELIGHT state when in_button...
+ 684076 clean up a11y on shutdown
+ 684096 GtkWidget:drag-data-received code sample refers to rem...
+ 684156 fontchooserwidget: scroll to the currently selected row
+
+* Translation updates
+ Arabic
+ Assamese
+ Belarusian
+ Brazilian Portuguese
+ British English
+ Danish
+ Finnish
+ French
+ Galician
+ Greek
+ Hebrew
+ Hungarian
+ Indonesian
+ Korean
+ Lithuanian
+ Persian
+ Polish
+ Portuguese
+ Punjabi
+ Serbian
+ Slovenian
+ Thai
+ Spanish
+ Russian
+ Traditional Chinese
+
+
+Overview of Changes in GTK+ 3.5.16
+==================================
+
+* Fix critical warnings on startup in nautilus
+
+
+Overview of Changes in GTK+ 3.5.14
+==================================
+
+* Input method support
+ - Propagate input purpose and hints to individual IMs
+ - Add a hint to suppress on-screen keyboards
+
+* GtkEntry can now set Pango attributes for its text
+
+* GtkEntry and GtkTextView show 'selection handles' when
+ used with touch devices
+
+* GtkSpinButton can be oriented vertically
+
+* Bugs fixed
+ 645065 GtkFileChooserButton doesn't handle closing its dialo...
+ 661973 gtk+ reacts on F10 press incorrectly with xkeyboard-c...
+ 672046 Issues with widget state propagation
+ 672431 the alt+tab app switch makes mnemonics flash
+ 676787 Update printing demo to use new print setting
+ 679144 Gdk doesn't properly find the child area with alpha
+ 681617 radio button text isn't centered when draw indicator ...
+ 682129 Print Dialog / Improving "Print to file" option
+ 682291 GtkMenuButton .ui issues
+ 682552 Improve the layout of the mount operations dialog
+ 682662 GtkAspectFrame: vertical alignment should be top/bott...
+ 682724 Fix a typo in the the comments
+ 682825 Also compile gtkdbusgenerated.c on non-UNIX environme...
+ 682919 Crash in GTK+-3.x (3.0.x-3.5.12+) on Windows with CJK...
+ 683001 Make headings bold in message dialogs by default
+ 683168 Make spinbutton orientable
+
+* Translation updates
+ Assamese
+ French
+ Galician
+ Greek
+ Indonesian
+ Japanese
+ Kazakh
+ Latvian
+ Lithuanian
+ Norwegian bokmål
+ Persian
+ Polish
+ Punjabi
+ Spanish
+ Vietnamese
+
+
Overview of Changes in GTK+ 3.5.12
==================================
diff --git a/README.in b/README.in
index 0fe846db25..b5d9f30fe4 100644
--- a/README.in
+++ b/README.in
@@ -75,8 +75,17 @@ Patches should be in unified diff form. (The -up option to GNU diff.)
Release notes for 3.6
=====================
-* Now follows the XDG Base Directory specification for user
- configuration and data files. In detail,
+* The accessibility bridge code that exports accessible objects
+ on the bus is now used by default; atk-bridge has been converted
+ into a library that GTK+ links against. To void the linking,
+ pass --without-atk-bridge when configuring GTK+.
+
+* GDK threading support has been deprecated. It is recommended to
+ use g_idle_add(), g_main_context_invoke() and similar funtions
+ to make all GTK+ calls from the main thread.
+
+* GTK+ now follows the XDG Base Directory specification for
+ user configuration and data files. In detail,
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
for $HOME/.gtk-custom-papers
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location
diff --git a/build/win32/vs10/gtk+.props b/build/win32/vs10/gtk+.props
index da992ae52d..b61daeb04b 100644
--- a/build/win32/vs10/gtk+.props
+++ b/build/win32/vs10/gtk+.props
@@ -18,24 +18,24 @@ mkdir $(CopyDir)\bin
copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
+copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
-mkdir $(CopyDir)\bin\gtk3-demo
-copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin\gtk3-demo
+mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
-copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo
+copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
mkdir $(CopyDir)\lib
@@ -319,6 +319,8 @@ copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
@@ -331,6 +333,8 @@ copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
@@ -411,6 +415,8 @@ copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
diff --git a/build/win32/vs10/gtk3-demo.vcxproj b/build/win32/vs10/gtk3-demo.vcxproj
index 3c38828a90..72da6e9559 100644
--- a/build/win32/vs10/gtk3-demo.vcxproj
+++ b/build/win32/vs10/gtk3-demo.vcxproj
@@ -176,6 +176,8 @@
+
+
diff --git a/build/win32/vs10/gtk3-demo.vcxproj.filters b/build/win32/vs10/gtk3-demo.vcxproj.filters
index efedcfff11..cfbb17b8aa 100644
--- a/build/win32/vs10/gtk3-demo.vcxproj.filters
+++ b/build/win32/vs10/gtk3-demo.vcxproj.filters
@@ -47,6 +47,12 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
Source Files
diff --git a/build/win32/vs9/gtk+.vsprops b/build/win32/vs9/gtk+.vsprops
index 67f8635dd8..97b98a9cac 100644
--- a/build/win32/vs9/gtk+.vsprops
+++ b/build/win32/vs9/gtk+.vsprops
@@ -69,16 +69,17 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h
echo on
mkdir $(CopyDir)\bin
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin
+copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin
-mkdir $(CopyDir)\bin\gtk3-demo
-copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo
-copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo
+mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+
+copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
+copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
mkdir $(CopyDir)\lib
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(CopyDir)\lib
@@ -222,12 +223,14 @@ copy ..\..\..\gtk\gtkinfobar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkinvisible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklockbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmain.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenutoolbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
@@ -268,6 +271,7 @@ copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkscrollable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
+copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
diff --git a/build/win32/vs9/gtk3-demo.vcproj b/build/win32/vs9/gtk3-demo.vcproj
index 850aebc2ee..37026f8fee 100644
--- a/build/win32/vs9/gtk3-demo.vcproj
+++ b/build/win32/vs9/gtk3-demo.vcproj
@@ -171,6 +171,8 @@
+
+
diff --git a/configure.ac b/configure.ac
index 3acb40d90c..cfe6b51718 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,9 +9,9 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3])
-m4_define([gtk_minor_version], [5])
-m4_define([gtk_micro_version], [13])
-m4_define([gtk_interface_age], [0])
+m4_define([gtk_minor_version], [6])
+m4_define([gtk_micro_version], [2])
+m4_define([gtk_interface_age], [2])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -383,7 +383,7 @@ else
fi
AC_SUBST(DISABLE_ON_QUARTZ)
-if test "x$enable_broadway_backend" == xyes; then
+if test "x$enable_broadway_backend" = xyes; then
GDK_BACKENDS="$GDK_BACKENDS broadway"
cairo_backends="$cairo_backends cairo"
GDK_WINDOWING="$GDK_WINDOWING
@@ -394,8 +394,8 @@ else
AM_CONDITIONAL(USE_BROADWAY, false)
fi
-if test "x$enable_wayland_backend" == "xyes"; then
- if test "x$enable_wayland_cairo_gl" == "xyes"; then
+if test "x$enable_wayland_backend" = "xyes"; then
+ if test "x$enable_wayland_cairo_gl" = "xyes"; then
# Wayland can use cairo-gl
cairo_backends="$cairo_backends cairo-gl"
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
@@ -408,7 +408,7 @@ if test "x$enable_wayland_backend" == "xyes"; then
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_WAYLAND"
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-cursor"
- if test "x$enable_wayland_cairo_gl" == "xyes"; then
+ if test "x$enable_wayland_cairo_gl" = "xyes"; then
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
fi
AM_CONDITIONAL(USE_WAYLAND, true)
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index 0ff892ed70..afdda22d21 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -18,6 +18,8 @@ demos = \
css_accordion.c \
css_basics.c \
css_multiplebgs.c \
+ css_pixbufs.c \
+ css_shadows.c \
dialog.c \
drawingarea.c \
editable_cells.c \
@@ -118,6 +120,8 @@ RESOURCES= application.ui \
css_accordion.css \
css_basics.css \
css_multiplebgs.css \
+ css_pixbufs.css \
+ css_shadows.css \
cssview.css \
fancy.css \
reset.css
diff --git a/demos/gtk-demo/css_accordion.c b/demos/gtk-demo/css_accordion.c
index 57a35b6d8e..65f084b4d3 100644
--- a/demos/gtk-demo/css_accordion.c
+++ b/demos/gtk-demo/css_accordion.c
@@ -61,6 +61,7 @@ do_css_accordion (GtkWidget *do_widget)
data = g_bytes_get_data (bytes, &data_size);
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL);
+ g_bytes_unref (bytes);
apply_css (window, provider);
}
diff --git a/demos/gtk-demo/css_accordion.css b/demos/gtk-demo/css_accordion.css
index ffca895b08..df01971f19 100644
--- a/demos/gtk-demo/css_accordion.css
+++ b/demos/gtk-demo/css_accordion.css
@@ -1,4 +1,4 @@
-@import url("reset.css");
+@import url("resource:///reset.css");
* {
transition-property: color, background-color, border-color, background-image, padding, border-width;
@@ -49,4 +49,4 @@ GtkWindow {
.button:hover:active,
.button:active {
background-color: #993401;
-}
\ No newline at end of file
+}
diff --git a/demos/gtk-demo/css_basics.c b/demos/gtk-demo/css_basics.c
index b8ee6684f8..5929d150e3 100644
--- a/demos/gtk-demo/css_basics.c
+++ b/demos/gtk-demo/css_basics.c
@@ -100,6 +100,7 @@ do_css_basics (GtkWidget *do_widget)
bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+ g_bytes_unref (bytes);
g_signal_connect (provider,
"parsing-error",
diff --git a/demos/gtk-demo/css_basics.css b/demos/gtk-demo/css_basics.css
index bd6a6944b9..793512daa9 100644
--- a/demos/gtk-demo/css_basics.css
+++ b/demos/gtk-demo/css_basics.css
@@ -6,7 +6,7 @@
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
-@import url("reset.css");
+@import url("resource:///reset.css");
/* Set a very futuristic style by default */
* {
diff --git a/demos/gtk-demo/css_multiplebgs.c b/demos/gtk-demo/css_multiplebgs.c
index e05961f84f..6dececcb3a 100644
--- a/demos/gtk-demo/css_multiplebgs.c
+++ b/demos/gtk-demo/css_multiplebgs.c
@@ -149,6 +149,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+ g_bytes_unref (bytes);
g_signal_connect (provider,
"parsing-error",
diff --git a/demos/gtk-demo/css_multiplebgs.css b/demos/gtk-demo/css_multiplebgs.css
index f950d32f93..36c1f8c441 100644
--- a/demos/gtk-demo/css_multiplebgs.css
+++ b/demos/gtk-demo/css_multiplebgs.css
@@ -6,8 +6,8 @@
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
-@import url("reset.css");
-@import url("cssview.css");
+@import url("resource:///reset.css");
+@import url("resource:///cssview.css");
#canvas {
transition-property: background-color, background-image;
@@ -56,7 +56,7 @@
/*
#bricks-button {
background-color: #eef;
- background-image: url('brick.png');
+ background-image: url('resource:///css_multiplebgs/brick.png');
background-repeat: no-repeat;
background-position: center;
}
@@ -133,4 +133,4 @@
background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px),
linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px);
}
-*/
\ No newline at end of file
+*/
diff --git a/demos/gtk-demo/css_pixbufs.c b/demos/gtk-demo/css_pixbufs.c
new file mode 100644
index 0000000000..c2b32b51cb
--- /dev/null
+++ b/demos/gtk-demo/css_pixbufs.c
@@ -0,0 +1,127 @@
+/* CSS Theming/Animated backgrounds
+ *
+ * This demo is done in honour of the Pixbufs demo further down. It is done exclusively
+ * with CSS as the background of the window.
+ */
+
+#include
+
+static GtkWidget *window = NULL;
+
+static void
+show_parsing_error (GtkCssProvider *provider,
+ GtkCssSection *section,
+ const GError *error,
+ GtkTextBuffer *buffer)
+{
+ GtkTextIter start, end;
+ const char *tag_name;
+
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &start,
+ gtk_css_section_get_start_line (section),
+ gtk_css_section_get_start_position (section));
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &end,
+ gtk_css_section_get_end_line (section),
+ gtk_css_section_get_end_position (section));
+
+ if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
+ tag_name = "warning";
+ else
+ tag_name = "error";
+
+ gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
+}
+
+static void
+css_text_changed (GtkTextBuffer *buffer,
+ GtkCssProvider *provider)
+{
+ GtkTextIter start, end;
+ char *text;
+
+ gtk_text_buffer_get_start_iter (buffer, &start);
+ gtk_text_buffer_get_end_iter (buffer, &end);
+ gtk_text_buffer_remove_all_tags (buffer, &start, &end);
+
+ text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+ gtk_css_provider_load_from_data (provider, text, -1, NULL);
+ g_free (text);
+
+ gtk_style_context_reset_widgets (gdk_screen_get_default ());
+}
+
+static void
+apply_css (GtkWidget *widget, GtkStyleProvider *provider)
+{
+ gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
+ if (GTK_IS_CONTAINER (widget))
+ gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
+}
+
+GtkWidget *
+do_css_pixbufs (GtkWidget *do_widget)
+{
+ if (!window)
+ {
+ GtkWidget *paned, *container, *child;
+ GtkStyleProvider *provider;
+ GtkTextBuffer *text;
+ GBytes *bytes;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
+ gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &window);
+
+ paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+ gtk_container_add (GTK_CONTAINER (window), paned);
+
+ /* Need a filler so we get a handle */
+ child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_container_add (GTK_CONTAINER (paned), child);
+
+ text = gtk_text_buffer_new (NULL);
+ gtk_text_buffer_create_tag (text,
+ "warning",
+ "underline", PANGO_UNDERLINE_SINGLE,
+ NULL);
+ gtk_text_buffer_create_tag (text,
+ "error",
+ "underline", PANGO_UNDERLINE_ERROR,
+ NULL);
+
+ provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
+
+ container = gtk_scrolled_window_new (NULL, NULL);
+ gtk_container_add (GTK_CONTAINER (paned), container);
+ child = gtk_text_view_new_with_buffer (text);
+ gtk_container_add (GTK_CONTAINER (container), child);
+ g_signal_connect (text,
+ "changed",
+ G_CALLBACK (css_text_changed),
+ provider);
+
+ bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL);
+ gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+
+ g_signal_connect (provider,
+ "parsing-error",
+ G_CALLBACK (show_parsing_error),
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
+
+ apply_css (window, provider);
+ }
+
+ if (!gtk_widget_get_visible (window))
+ gtk_widget_show_all (window);
+ else
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
+}
diff --git a/demos/gtk-demo/css_pixbufs.css b/demos/gtk-demo/css_pixbufs.css
index c6440b3187..8eb21d664f 100644
--- a/demos/gtk-demo/css_pixbufs.css
+++ b/demos/gtk-demo/css_pixbufs.css
@@ -6,8 +6,8 @@
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
-@import url("reset.css");
-@import url("cssview.css");
+@import url("resource:///reset.css");
+@import url("resource:///cssview.css");
@keyframes move-the-image {
0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
@@ -46,21 +46,31 @@
}
@keyframes size-the-image {
- 0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, 100% }
- 100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, 100% }
+ 0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto }
+ 100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto }
}
GtkWindow {
- background-image: url("apple-red.png"),
- url("gnome-applets.png"),
- url("gnome-calendar.png"),
- url("gnome-foot.png"),
- url("gnome-gmush.png"),
- url("gnome-gimp.png"),
- url("gnome-gsame.png"),
- url("gnu-keys.png"),
- url("background.jpg");
+ background-image: url("resource:///css_pixbufs/apple-red.png"),
+ url("resource:///css_pixbufs/gnome-applets.png"),
+ url("resource:///css_pixbufs/gnome-calendar.png"),
+ url("resource:///css_pixbufs/gnome-foot.png"),
+ url("resource:///css_pixbufs/gnome-gmush.png"),
+ url("resource:///css_pixbufs/gnome-gimp.png"),
+ url("resource:///css_pixbufs/gnome-gsame.png"),
+ url("resource:///css_pixbufs/gnu-keys.png"),
+ url("resource:///css_pixbufs/background.jpg");
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s;
}
+
+/* Make the text editor has a nice style */
+.view, .scrollbar, .pane-separator {
+ color: black;
+ background-color: rgba(255,255,255,0.5);
+}
+
+.view:selected {
+ background-color: rgba(127,127,255,0.5);
+}
diff --git a/demos/gtk-demo/css_shadows.c b/demos/gtk-demo/css_shadows.c
new file mode 100644
index 0000000000..382d5585a6
--- /dev/null
+++ b/demos/gtk-demo/css_shadows.c
@@ -0,0 +1,147 @@
+/* CSS Theming/Shadows
+ *
+ * This demo shows how to use CSS shadows.
+ */
+
+#include
+
+static GtkWidget *window = NULL;
+
+static void
+show_parsing_error (GtkCssProvider *provider,
+ GtkCssSection *section,
+ const GError *error,
+ GtkTextBuffer *buffer)
+{
+ GtkTextIter start, end;
+ const char *tag_name;
+
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &start,
+ gtk_css_section_get_start_line (section),
+ gtk_css_section_get_start_position (section));
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &end,
+ gtk_css_section_get_end_line (section),
+ gtk_css_section_get_end_position (section));
+
+ if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
+ tag_name = "warning";
+ else
+ tag_name = "error";
+
+ gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
+}
+
+static void
+css_text_changed (GtkTextBuffer *buffer,
+ GtkCssProvider *provider)
+{
+ GtkTextIter start, end;
+ char *text;
+
+ gtk_text_buffer_get_start_iter (buffer, &start);
+ gtk_text_buffer_get_end_iter (buffer, &end);
+ gtk_text_buffer_remove_all_tags (buffer, &start, &end);
+
+ text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+ gtk_css_provider_load_from_data (provider, text, -1, NULL);
+ g_free (text);
+
+ gtk_style_context_reset_widgets (gdk_screen_get_default ());
+}
+
+static void
+apply_css (GtkWidget *widget, GtkStyleProvider *provider)
+{
+ gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
+ if (GTK_IS_CONTAINER (widget))
+ gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
+}
+
+GtkWidget *
+create_toolbar (void)
+{
+ GtkWidget *toolbar;
+ GtkToolItem *item;
+
+ toolbar = gtk_toolbar_new ();
+ gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER);
+
+ item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+
+ item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+
+ item = gtk_tool_button_new (NULL, "Hello World");
+ gtk_tool_item_set_is_important (item, TRUE);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+
+ return toolbar;
+}
+
+GtkWidget *
+do_css_shadows (GtkWidget *do_widget)
+{
+ if (!window)
+ {
+ GtkWidget *paned, *container, *child;
+ GtkStyleProvider *provider;
+ GtkTextBuffer *text;
+ GBytes *bytes;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
+ gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &window);
+
+ paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+ gtk_container_add (GTK_CONTAINER (window), paned);
+
+ child = create_toolbar ();
+ gtk_container_add (GTK_CONTAINER (paned), child);
+
+ text = gtk_text_buffer_new (NULL);
+ gtk_text_buffer_create_tag (text,
+ "warning",
+ "underline", PANGO_UNDERLINE_SINGLE,
+ NULL);
+ gtk_text_buffer_create_tag (text,
+ "error",
+ "underline", PANGO_UNDERLINE_ERROR,
+ NULL);
+
+ provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
+
+ container = gtk_scrolled_window_new (NULL, NULL);
+ gtk_container_add (GTK_CONTAINER (paned), container);
+ child = gtk_text_view_new_with_buffer (text);
+ gtk_container_add (GTK_CONTAINER (container), child);
+ g_signal_connect (text,
+ "changed",
+ G_CALLBACK (css_text_changed),
+ provider);
+
+ bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL);
+ gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
+
+ g_signal_connect (provider,
+ "parsing-error",
+ G_CALLBACK (show_parsing_error),
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
+
+ apply_css (window, provider);
+ }
+
+ if (!gtk_widget_get_visible (window))
+ gtk_widget_show_all (window);
+ else
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
+}
diff --git a/demos/gtk-demo/css_shadows.css b/demos/gtk-demo/css_shadows.css
new file mode 100644
index 0000000000..5fcacfdf0d
--- /dev/null
+++ b/demos/gtk-demo/css_shadows.css
@@ -0,0 +1,44 @@
+/* You can edit the text in this window to change the
+ * appearance of this Window.
+ * Be careful, if you screw it up, nothing might be visible
+ * anymore. :)
+ */
+
+/* This CSS resets all properties to their defaults values
+ * and overrides all user settings and the theme in use */
+@import url("resource:///reset.css");
+@import url("resource:///cssview.css");
+
+/* Get a nice background for the window */
+.background {
+ background-color: #4870bc;
+ background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%),
+ linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%),
+ linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%),
+ linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%);
+ background-size: 29px, 59px, 73px, 109px;
+}
+
+.button {
+ color: black;
+ padding: 10px;
+ border-radius: 5px;
+ transition: all 250ms ease-in;
+ border: 1px transparent solid;
+}
+
+.button:hover {
+ text-shadow: 3px 3px 5px alpha(black, 0.75);
+ icon-shadow: 3px 3px 5px alpha(black, 0.75);
+ box-shadow: 3px 3px 5px alpha(black, 0.5) inset;
+ border: solid 1px alpha(black, 0.75);
+}
+
+.button:active {
+ padding: 11px 9px 9px 11px;
+ text-shadow: 1px 1px 2.5px alpha(black, 0.6);
+ icon-shadow: 1px 1px 2.5px alpha(black, 0.6);
+}
+
+
+
diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml
index 12c7c73637..3abc856055 100644
--- a/demos/gtk-demo/demo.gresource.xml
+++ b/demos/gtk-demo/demo.gresource.xml
@@ -20,6 +20,7 @@
css_multiplebgs.css
+ brick.png
fancy.css
@@ -27,4 +28,19 @@
theming.ui
+
+ css_pixbufs.css
+ background.jpg
+ apple-red.png
+ gnome-applets.png
+ gnome-calendar.png
+ gnome-foot.png
+ gnome-gmush.png
+ gnome-gimp.png
+ gnome-gsame.png
+ gnu-keys.png
+
+
+ css_shadows.css
+
diff --git a/demos/gtk-demo/fancy.css b/demos/gtk-demo/fancy.css
index a3d2ac3cb6..97bd5dc162 100644
--- a/demos/gtk-demo/fancy.css
+++ b/demos/gtk-demo/fancy.css
@@ -1,24 +1,65 @@
GtkButton#fancy {
- font-weight: bold;
- background-image: linear-gradient(135deg, yellow, blue);
- border-radius: 20px;
- color: white;
+ transition: none;
+ background-image: linear-gradient(to bottom,
+ alpha(white, 0.7),
+ alpha(white, 0) 30%),
+ linear-gradient(to top,
+ alpha(#babdb6, 0.4),
+ alpha(#babdb6, 0) 50%),
+ linear-gradient(135deg,
+ #eeeeec,
+ white 20%,
+ #d3d7cf,
+ white 80%,
+ #babdb6);
+ color: #3465a4;
+ font-weight: bold;
+ text-shadow: 0 1px white;
}
GtkButton#fancy:hover {
- font-weight: bold;
- background-image: linear-gradient(135deg, blue, yellow);
- border-radius: 20px;
- color: white;
+ transition: all 250ms linear;
+ background-image: linear-gradient(to bottom,
+ alpha(white, 1),
+ alpha(white, 0)),
+ linear-gradient(135deg,
+ #eeeeec 10%,
+ white 40%,
+ #d3d7cf,
+ white 70%,
+ #babdb6);
+ color: #204a87;
}
-GtkButton#fancy:active {
- font-weight: bold;
- background-image: linear-gradient(yellow, yellow);
- border-radius: 20px;
- color: black;
+GtkButton#fancy:active,
+GtkButton#fancy:active:hover {
+ transition: none;
+ background-image: linear-gradient(to bottom,
+ alpha(#555753, 0.5),
+ alpha(#babdb6, 0.3)),
+ linear-gradient(135deg,
+ #eeeeec,
+ white 20%,
+ #d3d7cf,
+ white 80%,
+ #babdb6);
+ color: white;
+ text-shadow: 0 1px black;
+}
+
+GtkButton#fancy:backdrop,
+GtkButton#fancy:backdrop:hover {
+ transition: none;
+ background-image: linear-gradient(135deg,
+ alpha(#eeeeec, 0.5) 10%,
+ alpha(white, 0.5) 40%,
+ alpha(#d3d7cf, 0.5),
+ alpha(white, 0.5) 70%,
+ alpha(#babdb6, 0.5));
+ color: #babdb6;
}
GtkButton#fancy * {
- color: inherit;
+ /* Yeah this should be inherited by default */
+ color: inherit;
}
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 2ac72170d1..935b86eeff 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -579,10 +579,7 @@ load_file (const gchar *filename)
}
if (current_file && !strcmp (current_file, names[0]))
- {
- g_string_free (buffer, TRUE);
- return;
- }
+ goto out;
g_free (current_file);
current_file = g_strdup (names[0]);
@@ -598,7 +595,7 @@ load_file (const gchar *filename)
{
g_warning ("%s", err->message);
g_error_free (err);
- return;
+ goto out;
}
file = g_fopen (full_filename, "r");
@@ -609,7 +606,7 @@ load_file (const gchar *filename)
g_free (full_filename);
if (!file)
- return;
+ goto out;
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
while (read_line (file, buffer))
@@ -725,6 +722,7 @@ load_file (const gchar *filename)
fontify ();
+out:
g_string_free (buffer, TRUE);
g_strfreev (names);
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 7c30f91f18..84ead9749d 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -65,12 +65,26 @@ show_about (GtkMenuItem *item, GtkWidget *window)
g_object_unref (pixbuf);
}
+static void
+on_page_toggled (GtkToggleButton *button,
+ GtkNotebook *pages)
+{
+ gint page;
+
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "page"));
+ gtk_notebook_set_current_page (pages, page);
+}
+
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
GtkWidget *widget;
+ GtkWidget *notebook;
gboolean dark = FALSE;
gtk_init (&argc, &argv);
@@ -88,6 +102,15 @@ main (int argc, char *argv[])
g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark);
+ notebook = (GtkWidget*) gtk_builder_get_object (builder, "toplevel_notebook");
+ widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage1");
+ g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (0));
+ g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
+
+ widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage2");
+ g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (1));
+ g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
+
widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem");
g_signal_connect (widget, "activate", G_CALLBACK (show_about), window);
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 22a95187e1..b76e04e8d4 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -475,6 +475,47 @@ Suspendisse feugiat quam quis dolor accumsan cursus.
True
+
+
+
+ True
+ True
+
+
- True
+ False
True
@@ -515,108 +556,484 @@ Suspendisse feugiat quam quis dolor accumsan cursus.
-