Commit Graph

119 Commits

Author SHA1 Message Date
Matthias Clasen
23d7c3d435 gtk-demo:Add a --list option
This just shows the available examples and then exists.
2015-09-09 10:14:17 -04:00
Matthias Clasen
bce8d771a2 gtk-demo: Make --autoquit a simple option
No real need to specify the amount of delay, just make this
a plain boolean.
2015-09-09 08:07:20 -04:00
Matthias Clasen
e559a310c6 gtk-demo: Add a way to launch individual demos
Add a --run option which takes the name of an example and
launches it. Also add a --autoquit option which can be used
to quit after a given number of seconds.
2015-09-06 17:11:33 -04:00
Matthias Clasen
ab09ffaa8c gtk-demo: Use top/bottom-margin for text views
This lets us replace the hack of inserting tags in the first
and last paragraph to set a above/below-paragraph space.
2015-08-17 01:40:32 -04:00
Matthias Clasen
1fb154e62a gtk3-demo: Add a scrollbar context menu
Just to demonstrate the capability, not because this is
excellent UI.
2015-07-28 23:48:10 -04:00
Matthias Clasen
770fc90e7c gtk-demo: Check a return value
Found by coverity.
2015-07-17 16:11:16 -04:00
Matthias Clasen
fa1bb8972a gtk-demo: Plug a memory leak 2015-03-19 22:57:10 -04:00
Matthias Clasen
d50dd1d33c gtk3-demo: Use better text margins
We really want margins around the scrollable content, not around
the viewport. Make it so by using textview-specific properties.
This is unfortunately a little complicated for top/bottom.
2014-11-12 16:05:49 -05:00
Matthias Clasen
d120346992 gtk3-demo: Don't use deprecated API
Replace various override calls.
2014-10-07 00:48:30 -04:00
Matthias Clasen
6ce24d82d6 gtk-demo: Don't create 2 main windows
Loading a builder file with a window leaves a ghost behind, since
windows need to be explicitly destroyed. Avoid that by using
gtk_builder_add_objects_from_resource.
2014-09-25 23:57:34 -04:00
Benjamin Otte
4a6ecf33fc gtk-demo: Don't use mad mime type guessing
... for displaying resources. Instead use the proven and way more
reliable method of trial and error.

It's less code and more portable for a start.
But most of all it displays PNM files as text if you fail to compile
the gdk-pixbuf loader for it.
2014-08-27 18:02:48 +02:00
Benjamin Otte
e29d0a0a38 gtk-demo: This is not a unique app
When running gtk-demo a 2nd time, it's usually to compare its
output with a different version of gtk-demo.
2014-07-12 07:13:28 +02:00
Matthias Clasen
e51e8a28dd gtk3-demo: Use monospace font for source code 2014-06-10 18:47:49 -04:00
Matthias Clasen
d67751d0cc gtk3-demo: Drop unneeded gtk_init() call
GtkApplication is doing this for us.
2014-05-12 22:38:37 -04:00
Benjamin Otte
f123fe7fe7 gtk-demo: Make double-click work again 2013-12-13 19:07:42 +01:00
William Jon McCann
7ba0083fc9 demo: only set transient if demo returns a toplevel 2013-12-09 09:55:39 +01:00
William Jon McCann
8193c8c770 demo: make demo windows transient to the main window
This prevents them getting lost behind.
2013-12-03 10:50:07 -05:00
William Jon McCann
e5726e97f4 demo: Add a GtkHeaderBar 2013-12-03 10:50:07 -05:00
William Jon McCann
f115af11d2 demo: expand notebook tabs 2013-12-03 10:50:07 -05:00
William Jon McCann
70bc941b73 demo: Port to GtkApplication
And use GtkBuilder to construct interface.
2013-12-03 10:50:07 -05:00
William Jon McCann
cdc2f07a1e demo: use the installed named icon 2013-11-05 15:31:11 -05:00
Jasper St. Pierre
0280ef3413 Make gtk-demo use the newer app icon 2013-10-07 16:30:33 -04:00
William Jon McCann
2bb01c6cc8 demo: Show popup menu on tabs
https://bugzilla.gnome.org/show_bug.cgi?id=707920
2013-10-02 10:51:15 -04:00
William Jon McCann
708dd8cc52 Remove usage of stock APIs in demo
With the exception of GtkAction.
2013-06-24 14:50:01 -04:00
Matthias Clasen
0b3461ff1b gtk-demo: Don't include config.h needlessly
It is not needed here.
2013-05-05 15:38:46 -04:00
Chun-wei Fan
b1aa23f4bd Bug 695895: Fix gtk3-demo on Windows
In commit 4e41577b, we are using g_content_type_is_a() to determine how
to display the demo resources in the right pane of the gtk3-demo program.

Use g_content_type_get_mime_type(), so that we can obtain the mime
type of the demo resources on all platforms, as g_content_type_guess()
returns a platform-specific string, as
https://developer.gnome.org/gio/2.35/gio-GContentType.html states.

As .ui files and .css files are normally registered with a different mime
type string on Windows, check for those strings as well.

This will ensure the demo resources can be properly displayed on Windows
as well.
2013-03-26 16:59:16 +08:00
Benjamin Otte
46ef9a83bb gtk-demo: Create new textbuffers for new source/info texts
This is so we can prepare these buffers without them being set on the
widgets yet and only gtk_text_view_set_buffer() them afterwards. And
this in turn gets rid of all the a11y events we were needlessly
emitting.

https://bugzilla.gnome.org/show_bug.cgi?id=694406
2013-02-26 15:56:51 +01:00
Matthias Clasen
e975f10c7f Make the text look a bit nicer
Add a margin around the text, and some space between the title
and the body of the info tab.
2013-02-01 21:56:25 -05:00
Matthias Clasen
ee6e7d6433 Set the notebook to be scrollable
The pixbufs example has just too many files..
2013-02-01 21:46:07 -05:00
Benjamin Otte
bc473257c7 gtk-demo: Replace logo with a transparent one
That way, we don't have to make it transparent in all the demos.
2013-02-01 21:57:40 +01:00
Benjamin Otte
80fc684dd8 gtk-demo: Remove file lists from demo data
We can get it from parsing resources now, so no need to manually add
them.
2013-02-01 21:57:40 +01:00
Benjamin Otte
4e41577b46 gtk-demo: Display all resources on the right side
This way, people know what stuff we are loading.

And instead of listing all the files in the top (and forgetting things),
we just take them from the resources list.
2013-02-01 21:57:39 +01:00
Benjamin Otte
ad69528bde gtk-demo: Remove demo_find_file() function
It's not used anymore. With it, the demo-common.h header is not needed
anymore and is removed, too (and all the needless includes).
2013-02-01 17:44:13 +01:00
Benjamin Otte
75937d925c gtk-demo: Load icon from resource 2013-02-01 17:42:45 +01:00
Benjamin Otte
0866772819 gtk-demo: Display extra files from resources 2013-02-01 17:42:45 +01:00
Benjamin Otte
39d198cd5a gtk-demo: Load sources from resources 2013-02-01 17:42:43 +01:00
Benjamin Otte
a0e68bec52 gtk-demo: Load the demo files using g_file_get_contents()
... instead of massaging a FILE* with flockfile() and ungetc().
2013-02-01 17:42:43 +01:00
Alexander Larsson
9d659d8a77 Remove accidental commit that broke gtk3-demo
A piece of test code accidentally snuck into a commit that
made gtk3-demo not find its data files, this patch just
reverts that change.
2013-01-29 11:55:05 +01:00
Alexander Larsson
ada20f475d broadway: Make /dev/shm names nicer 2013-01-10 23:59:23 +01:00
Matthias Clasen
d9c2f40a5d gtk-demo: Plug another small memleak 2012-09-15 16:17:02 -04:00
Cosimo Cecchi
46f967dd7a gtk-demo: don't try to add tabs for empty filenames 2012-05-30 13:17:23 -04:00
Benjamin Otte
6461105429 main: Don't overrun the file that's read 2012-05-30 13:17:23 -04:00
Matthias Clasen
5e7f8e4333 gtk-demo: Move Theming to Theming/Style Classes
And make the title :: parsing work for nested titles too,
so this works.
2012-05-25 20:40:47 -04:00
Matthias Clasen
91d01434bc gtk-demo: Show data files as well
Several demos use .ui files and the like. The demos are much
more useful if these files can be inspected in the ui as well.
2012-05-18 00:48:57 -04:00
Matthias Clasen
45d9b912d9 Add a GtkApplication example to gtk3-demo 2012-01-14 20:35:18 -05:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Matthias Clasen
1204a850f3 Formatting cleanups
While we normally try to avoid whitespace fixes, the gtk-demo
code is shown as exemplary, so it should be in good shape,
formatting-wise.
2011-09-01 23:56:58 -04:00
Kalev Lember
d86c1486ba gtk-demo: Fix the path to demo sources for the win32 build 2011-08-14 15:18:38 +03:00
Benjamin Otte
f6ee34c8b1 gtk-demo: Remove unused variable for text tags 2011-05-27 16:11:09 +02:00
Matthias Clasen
9b1118a35d Port gtk3-demo to GtkStyleContext 2010-12-04 15:39:46 +01:00