* Uses existing LexOthers.cxx from Scintilla already in use by Geany
* "identifier" style mapping goes to "string" for better presentation
even if it's semantically incorrect, we'll change it back if it causes
issues for anyone.
* Filetype configuration and keywords taken from Don Ho's Notepad++.
Closes#160
In the file properties dialog there are a few label for which the
default value is never visible to the user, and then don't need to be
translated. These strings are only useful to recognize and select the
label in e.g. Glade UI.
Rationale:
----------
* Existing View menu already contained Editor-related options
like "Change Font" and Zoom controls, so it makes sense to
group all of the View-related items together.
* Anecdotally, some users have been unable to easily discover
the Color Schemes changer dialog because it was nested under
a submenu.
* Distinction between "Editor" (Scintilla) and "Editor" (All
of Geany) is likely non-obvious to most users, especially
new users exploring the menus.
* There's not very many items to cause scrolling on low-res
monitors, and the View menu still has less items than the
Document menu.
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.
Pascal code only accepts an identifier in the program name directive,
but {untitled} wildcard gets replaced with a translated string that may
not be a valid Pascal identifier. Moreover, the directive being part
of the source of the program it's good practice for it to be in English
anyway.
Closes#3602314.
If we provide an AccelGroup when creating a menu item using a sock ID,
it installs the GTK default accelerator, accelerator we can't remove
since we don't know about it. So, don't give an AccelGroup so GTK
don't install it's own accelerator.
This fix also required to properly update the accelerator on some item
we used to ignore since the update didn't work anyway (since the GTK
accelerator was displayed instead).
Note that this doesn't fix the fact the editor popup menu accelerators
are never updated after startup so they don't get updated before
restart after changing a keybinding in the preferences. This is a
separate (and less problematic) issue due to a simple lack of update.
Closes#1912683 and #3599251.
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.
This allows the user to override the custom styles we apply to some
widgets, like e.g. the unmatched search entry colors.
We use the :theme priority rather than the :application one because
it seems that the :application one cannot override theme settings, even
if it matches against a name the theme don't have rules for but have
rules for the class of that widget. This prevents a theme from
overriding our styles, but it's unlikely a theme actually provide some
specific stuff for us anyway.