332 Commits

Author SHA1 Message Date
Colomban Wendling
17a7469b68 Avoid a few unnecessary widget lookups 2014-01-09 17:50:30 +01:00
Colomban Wendling
1dfc1077c7 Fix crash in fallback mime icon loading code under GTK3 2013-11-18 22:22:57 +01:00
Nick Treleaven
0998f1c19c Make code more readable by renaming poorly named macros NZV and NVL
Closes #159
2013-08-14 21:54:20 -07:00
Matthew Brush
d9ead8591a Make editor-related View menu items document-sensitive again
They used to be because their parent menu item (Editor) was
document-sensitive but now they are in the top of the View
menu they need to be invdividually made so.

TODO: should they really be/have been document-sensitive? They
can still change the pref without a document open and their
equivalent options in the Preferences dialog are not
document-sensitive? Same goes for existing "Change Font" item.
2013-04-27 11:42:04 -07:00
Matthew Brush
0f614dd885 Remove reference to removed "menu_view_editor1" (oops) 2013-04-26 23:56:16 -07:00
Colomban Wendling
659276730a Don't use deprecated gtk_icon_set_render_icon() on GTK3 2013-04-22 20:18:18 +02:00
Matthew Brush
d452d0b737 Cleanup statusbar template code a bit
* Unhardcode "pos" and "style" statusbar messages which were only
enabled when GEANY_DEBUG is defined and make them real possible
format chars.

* Move needless global "statusbar_template" into UIPrefs structure
with the other UI preferences, removing (now) pointless ui_finalize()
function.

* Rename "add_statusbar_statistics" to "create_statusbar_statistics"
and make it return a gchar* instead of passing in a GString argument
to update. Fixes a one-time "leak" of the GString and makes the code a
little easier to follow.

* Move the default statusbar template string to the top of the file
and use it as the default for the various preferences so the user has
something to base their customizations off of. TODO: check that the
N_() translations stuff works OK.
2013-04-14 19:03:58 -07:00
Colomban Wendling
232290aad4 Fix our custom styles under KDE and for people using gtk-chtheme
We have a custom RC file defining various styles we need, and we want
the user to be able to override them (e.g. if they want -- or need --
other colors).  Fair enough, one would simply call gtk_rc_parse() with
the appropriate filename.  However, the styling rules applies in the
order they are loaded, then if we load our styles after GTK has loaded
the user's ones we'd override them.

There are 2 solutions to fix this:
1) set our styles' priority to something with lower than "user"
   (actually "theme" priority because rules precedence are first
   calculated depending on the priority no matter of how precise the
   rules is, so we need to override the theme).
2) prepend our custom style to GTK's list while keeping priority to
   user (which is the default), so it gets loaded before real user's
   ones and so gets overridden by them.

One would normally go for 1 because it's ways simpler and requires less
code: you just have to add the priorities to your styles, which is a
matter of adding a few ":theme" in the RC file.  However, KDE being a
bitch it doesn't set the gtk-theme-name but rather directly includes
the style to use in a user gtkrc file, which makes the theme have
"user" priority, hence overriding our styles.  So, we cannot set
priorities in the RC file if we want to support running under KDE,
which pretty much leave us with no choice but to go with solution 2,
which unfortunately requires writing ugly code since GTK don't have a
gtk_rc_prepend_default_file() function.  Thank you very much KDE.

Though, as a side benefit it also makes the code work with people using
gtk-chtheme, which also found it funny to include the theme in the user
RC file.
2013-03-16 16:19:20 +01:00
Colomban Wendling
35cc441b74 Merge branch 'gtk3-support'
Conflicts:
	src/ui_utils.c
2013-03-10 17:20:25 +01:00
Dimitar Zhekov
99fbe0bd8c Fix plugin_add_toolbar_item insertion order 2013-02-22 17:14:53 +01:00
Colomban Wendling
a77ac1407a Merge branch 'master' into gtk3-support 2013-02-11 04:47:02 +01:00
Colomban Wendling
36581d6638 Move document status color definition to the gtkrc file
This allows for users to change the colors if needed (may be useful
with some themes or color blind persons).

On the sidebar, only the color is applied for now.  This is because
it is not possible to style cell renderers through RC files, all having
to be done in the code;  so currently only the color is applied.
2013-02-11 04:46:40 +01:00
Colomban Wendling
8ece89096d Merge branch 'master' into gtk3-support 2013-01-29 15:29:10 +01:00
Colomban Wendling
dabae1f94f Replace images embedded in the sources with proper themable icons
Additionally, provide SVG versions of the icons as well as them
rendered at the various icons sizes.
2013-01-01 19:10:48 +01:00
Colomban Wendling
bd02c009a1 Use the Geany icon from the theme everywhere 2013-01-01 19:10:04 +01:00
Colomban Wendling
d019741512 Properly register the statusbar context ID
Getting the statusbar context ID using the context registration API
allows for other (namely, plugins) to register their own context
without a risk of overriding Geany's one.
2012-12-02 18:03:14 +01:00
Colomban Wendling
f735e6800b Add GTK3 version of our custom styles
Although GTK3 still have gtk_rc_parse_string(), it doesn't work anymore
for our overrides, so register proper CSS for them.
2012-10-09 13:25:12 +02:00
Colomban Wendling
1839451363 Fix a packing issue on GTK3
GTK3 changed the default for expand and fill, so explicitly set them.
2012-10-09 13:25:12 +02:00
Colomban Wendling
6409840d4a Get rid of GtkComboBoxEntry API and use GtkComboBoxText API
Use the GtkComboBoxText API and the GtkComboBoxEntry replacement API
and map those to the old equivalents if not available.

This changes the type exposed by ui_combo_box_add_to_history() from
GtkComboBoxEntry to either GtkComboBox (under GTK2) or GtkComboBoxText
(under GTK3).  This should not be too much of an issue since
GtkComboBoxEntry and GtkComboBoxtext are subclasses of GtkComboBox,
but this will still emit warnings when when the calling code passes
a GtkComboBoxEntry pointer to ui_combo_box_add_to_history().

However, this requires the calling code to use the same mapping as we
do (GtkComboBoxText = GtkComboBox on GTK2, even on 2.24), or things
will blow and it'll be hard to understand why.  This wouldn't be an
issue if the calling code includes our gtkcompat.h header everywhere
it deals with combo boxes, which will be the case if it includes the
Geany headers everywhere but probably won't otherwise.  Oh dear.

A possible kind of workaround may be for ui_combo_box_add_to_history()
to do type-checking on its argument and use the actually correct API
for that type.
2012-10-08 20:08:06 +02:00
Colomban Wendling
a763e307f7 Don't access GtkWidget fields directly
Since many accessor are new in GTK versions we don't depend on, add
a header that defines them to the direct access if they aren't
available.
2012-10-08 20:08:06 +02:00
Colomban Wendling
eeddd6f720 Move custom styles to a resource file 2012-10-08 17:51:19 +02:00
Colomban Wendling
8289e8f962 Report scope including classes, namespaces and alike
Don't only match the current function as the current scope, but also
classes, namespaces and others containers.

Closes #1996778.
2012-09-17 22:51:36 +02:00
Colomban Wendling
593fef7fa0 Don't access GtkWidget:parent directly 2012-09-13 16:34:18 +02:00
Colomban Wendling
4d16735380 Don't access GtkDialog fields directly 2012-09-13 16:34:18 +02:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02:00
Colomban Wendling
4c2d8998d7 Fix a reference to a function in the documentation 2012-08-07 15:37:38 +02:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Matthew Brush
9d7ff79a9a Restore secondary clear icon functionality in Preferences dialog
Ensures all entries that get a clear icon added to the secondary position
also set the secondary icon to be activatable. This was probably
introducted during the Glade switch and could be fixed in the Glade file
but this fix ensures that even hard coded entries will always have their
clear icon activatable.
2012-06-04 14:18:49 -07:00
Frank Lanitz
58a03352b6 Enable two strings for translation. Patch by gymka 2012-06-03 17:48:30 +02:00
Colomban Wendling
1d6efd332e Remove an useless NULL check and error message
gtk_builder_new() cannot fail but in case of memory exhaustion, where
the GLib allocator will abort anyway.
2012-06-03 16:56:31 +02:00
Nick Treleaven
24359942bf Show selected line count on status bar when whole lines are selected 2012-04-22 17:32:53 +01:00
Nick Treleaven
fa7959f316 Maintain sidebar width when sidebar is on the right
Resizing the window should not affect sidebar width.
Fixes #3514436.
2012-04-03 16:15:02 +01:00
Frank Lanitz
4b1a3b39d4 Small changes on function documentation of ui_lookup_stock_label() as doxygen complained a bit 2012-02-19 10:30:31 +01:00
Nick Treleaven
b287553e4a Use 'SETPTR' instead of 'setptr'
This makes it clearer we're using a macro.
2012-01-25 16:26:16 +00:00
Colomban Wendling
9130b84d86 Add ui_builder_get_object()
This is used to get any object built from the UI file, not widgets only.
2012-01-20 19:14:31 +01:00
Nick Treleaven
1fcff6f7bf Fix unused variable warning 2012-01-09 15:58:10 +00:00
Colomban Wendling
aa96bc2cbf Add missing ComboBox cell renderers in Glade rather than manually
This also fixes the duplicated renderers when there was already one
in Glade, and a second one got added manually.
2012-01-08 22:55:28 +01:00
Nick Treleaven
eb04c514ba Add API function ui_lookup_stock_label()
Using this can avoid adding i18n strings unnecessarily.
2012-01-08 17:37:58 +00:00
Colomban Wendling
9e7301cdef Fix initial back and forward items sensitivity
These actions were marked as document sensitive but their sensitivity
is already managed by the navqueue, so making them document sensitive
only leads to them being wrongly updated when the document count
changes from or to 0.

So, make them initially insensitive and let the navqueue correctly
handle their later sensitiveness.
2011-12-18 00:32:22 +01:00
Matthew Brush
b60413ed60 Clean up some compiler warnings (oops) 2011-12-10 16:14:11 -08:00
Matthew Brush
7d6731279f Show error dialog if the Glade file could not be loaded
Also remove old comment that doesn't apply anymore.
2011-12-10 15:44:37 -08:00
Matthew Brush
467363adb9 Set translation domain for the GtkBuilder 2011-12-10 14:39:07 -08:00
Matthew Brush
906ffc6aae Fix some widget names in glade file and code so they match (oops) 2011-12-10 14:10:44 -08:00
Matthew Brush
0a16ec7520 Merge branch 'master' into gtkbuilder
Conflicts:
	src/interface.c
	src/vte.c
2011-11-06 23:44:24 -08:00
Colomban Wendling
b55a30c2bf Build recent data for GTK ourselves
This prevents GTK of trying to fetch the necessary information like
MIME-type itself, which leads to a significant speedup (> 30%), as
well as using the real MIME-type we use rather than the GIO-guessed
one.
2011-11-04 00:11:21 +01:00
Colomban Wendling
0167f589b3 Small code cleanup
Use foreach_document() in a few places where appropriate and make
some code more consistent.
2011-11-03 19:22:40 +01:00
Colomban Wendling
274e01f555 Fix various coding style issues 2011-10-30 22:55:25 +01:00
Colomban Wendling
36ebb1f2b7 Use canonical macros for stock items rather than plain strings
This makes the code more readable, potentially more future-proof (if
the actual string changes) and better style (catches possible typos at
build-time).
2011-10-30 22:01:49 +01:00
Matthew Brush
a23e999b7b Bump GTK+ version to 2.16 2011-10-28 10:25:58 -07:00
Matthew Brush
72e856947e Rework GtkBuilder code to behave more like old Glade 2 code
* Put back ui_hookup_widget and ui_lookup_widget functions
* Put back lookup_widget code in stash.c
* Emulate old create_*() functions from interface.[ch].
* Hookup all the GtkBuilder widget's to their top widgets like Glade 2
  generated code would've done.
* Misc changes to accomodate the above.
2011-10-19 00:44:35 -07:00