Commit Graph

165 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 89580f2113
sdgui: cross-compile for Windows
No one bothered to ask whether it /should/ be done.

The hamburger needs to be replaced with a file open dialog there.
2021-10-22 01:59:09 +02:00
Přemysl Eric Janouch 519d6bd108
sdgui: bind Up/Down to view scrolling 2021-10-20 11:51:38 +02:00
Přemysl Eric Janouch b721e26557
sdgui: improve styling of the text entry 2021-10-20 11:46:52 +02:00
Přemysl Eric Janouch ec89870a32
sdgui: trim selection text
Just like sdtui does.
2021-10-20 11:19:47 +02:00
Přemysl Eric Janouch 6158f6e3b5
sdgui: avoid Pango markup for keywords
Sadly, there is no way to make this an improvement for the end user.
2021-10-20 11:17:41 +02:00
Přemysl Eric Janouch dd7b258698
sdgui: make an attempt at smooth scrolling 2021-10-20 09:46:06 +02:00
Přemysl Eric Janouch aa3ad12d44
sdgui: decrease source code line count 2021-10-20 09:17:53 +02:00
Přemysl Eric Janouch 82accaf200
sdgui: make Page Up/Down scroll the view 2021-10-20 09:15:06 +02:00
Přemysl Eric Janouch e461189f0e
sdgui: ignore Caps Lock for accelerators 2021-10-20 08:58:53 +02:00
Přemysl Eric Janouch 85a30d20c3
sdgui: accelerate the hamburger
The hamburger initially resisted being accelerated.
2021-10-20 08:35:00 +02:00
Přemysl Eric Janouch 54ef836eec
sdgui: make even rows a bit darker by default 2021-10-17 12:46:06 +02:00
Přemysl Eric Janouch 26a3c0c825
sdgui: bind ^W as in Readline 2021-10-17 11:58:06 +02:00
Přemysl Eric Janouch c364ec3b81
sdgui: stop hardcoding cell side padding 2021-10-17 11:18:29 +02:00
Přemysl Eric Janouch a31d329754
sdgui: stop hardcoding colours
Reusing colours from sdtui configuration would be awkward
and complicated, e.g. with font attributes, so abandon that idea.
2021-10-17 09:37:32 +02:00
Přemysl Eric Janouch c0a094e473
sdgui: load dictionaries in parallel, as sdtui did
Also, resolve some use-after-frees in GTK+.
2021-10-16 08:34:37 +02:00
Přemysl Eric Janouch f147b54393
sdgui: load dictionaries from sdtui configuration 2021-10-16 06:46:44 +02:00
Přemysl Eric Janouch 10c05a2422
sdgui: clean-up
It doesn't seem like we'll want to remember the position.
2021-10-16 03:45:38 +02:00
Přemysl Eric Janouch 8fb2ce29cf
sdgui: clean up scrolling code 2021-10-15 23:59:45 +02:00
Přemysl Eric Janouch ce92a23551
sdgui: scroll by three rows
Don't use an arbitrary amount of pixels, base it off the font.
2021-10-15 23:09:26 +02:00
Přemysl Eric Janouch 573554b9de
sdgtk -> sdgui, improve build, mention in README
It's finally not horrible.
2021-10-15 12:09:37 +02:00
Přemysl Eric Janouch 9d7bc2a839
sdgtk: add and use a custom listview widget
Nothing in GTK+ appears to be suited for what are virtually infinite
lists.  Our workaround with GtkLabel and GtkScrolledWindow has been
heavily suboptimal and needs to be replaced.

Use Pango directly to handle our relatively simple needs.

Upgrades:
 - the widget can be scrolled,
 - keywords are repeated for each definition line,
 - definition lines are now wrapped, and support 'g' and 'x' fields.

Downgrades:
 - text can no longer be selected, so far.
2021-10-15 11:46:09 +02:00
Přemysl Eric Janouch 3d53b2c131
Fix g_option_context_get_help() usage 2021-10-12 02:39:16 +02:00
Přemysl Eric Janouch 627c296057
query-tool: support more field types
Add options to format the output for the terminal, or IRC messages.

Changed the output format to separate dictionary name with a tab,
so it's now rather similar to tabfiles.
2021-10-12 02:38:40 +02:00
Přemysl Eric Janouch e2790b42f3
sdtui: fix introductory message centring 2021-10-11 21:15:11 +02:00
Přemysl Eric Janouch 9b220b74cc
sdtui: minor rendering clean-up 2021-10-11 21:15:11 +02:00
Přemysl Eric Janouch 6f569e076e
sdtui: further improve the XML mangler
Comments should be more or less reliably handled by GMarkup now.
2021-10-11 06:32:00 +02:00
Přemysl Eric Janouch e57751fe0e
sdtui: skip keywords in XDXF 2021-10-11 02:43:34 +02:00
Přemysl Eric Janouch 4d6cd247cb
sdtui: implement elementary XDXF display
We're lacking word wrapping, but it's more or less usable.
2021-10-11 02:43:30 +02:00
Přemysl Eric Janouch 16d6eaf012
sdtui: support <b>/<i>/<u> in Pango entries 2021-10-10 06:13:49 +02:00
Přemysl Eric Janouch bc939712cb
sdtui: lay the groundwork for formatted entries 2021-10-10 06:13:49 +02:00
Přemysl Eric Janouch 6f7fbbb438
sdtui: keep the per-ViewEntry GPtrArrays 2021-10-10 06:13:48 +02:00
Přemysl Eric Janouch 39ff4069c0
tabfile: fix file format version downgrade 2021-10-10 01:57:51 +02:00
Přemysl Eric Janouch fbfd8c7d02
tabfile: add support for writing Pango markup
Enabling this option will ensure the field would parse.
2021-10-10 01:52:15 +02:00
Přemysl Eric Janouch 20fcf2a0c7
tabfile: make it possible to set metadata
And some related clean-up.
2021-10-07 16:28:44 +02:00
Přemysl Eric Janouch 3881725904
tabfile: remember to check UTF-8, glibize 2021-10-06 22:11:21 +02:00
Přemysl Eric Janouch 6c364dc997
Add an implementation of tabfile
The original one is a horrible thing.  Now we're self-reliant.
2021-10-06 22:04:55 +02:00
Přemysl Eric Janouch 690402f2e1
Unbreak stardict_dict_get_synonyms()
Untested, but certainly broken six ways to Sunday before.
2021-10-06 20:14:49 +02:00
Přemysl Eric Janouch 03f2123447
GLib-related improvements
Now all error messages produced by tools should be in the right
encoding, even if the system isn't in UTF-8.
2021-10-06 16:11:55 +02:00
Přemysl Eric Janouch 3c87b95c31
Make Tab put the current definition into search
Moving some X11-only code out.
2021-10-06 13:44:54 +02:00
Přemysl Eric Janouch 2b5eb86a9f
sdtui: enable styling of defocused selected rows
The defaults are unaffected, the row is always reverse, like it used to.

Having the deselected row just be underlined seems sensible.

It isn't currently possible to change /just/ the foreground or
the background colour of the selection, due to how ncurses works
with colours.

Bumped termo to enable requesting the appropriate events.
2021-07-03 11:44:01 +02:00
Přemysl Eric Janouch 85ca0c5857
sdtui: normalize whitespace in clipboard input 2021-07-03 11:36:46 +02:00
Přemysl Eric Janouch e47667b28a
sdgtk: don't follow our own selection
When the main window is focused, we are probably the owner of it.
2020-09-14 02:02:38 +02:00
Přemysl Eric Janouch aa19848499
Add an experimental GTK+ UI
It has a potential to stay simpler than the TUI,
while having a wider feature set.

Not building this toy by default, it needs some time investment.
2020-09-08 05:02:14 +02:00
Přemysl Eric Janouch 588b6ef8bb
Fix a segfault when search goes past the end
Removing a preprocessor macro in favor of a normal function.
2020-09-08 05:01:31 +02:00
Přemysl Eric Janouch fda956093c
Update copyright years within the program 2020-09-07 19:05:16 +02:00
Přemysl Eric Janouch 695f71d946
tools: clean up error message printing 2020-09-04 00:13:34 +02:00
Přemysl Eric Janouch 8d19acd91a
Add a tool to transform dictionaries 2020-09-04 00:13:34 +02:00
Přemysl Eric Janouch dd2bd04a07
Fix a typo 2020-09-03 23:15:59 +02:00
Přemysl Eric Janouch bbe22712fe
Enable switching among more than 10 dictionaries
Ctrl + PageUp/PageDown/Left/Right now change the active tab.
2020-09-02 16:29:59 +02:00
Přemysl Eric Janouch 37bf8ee648
Name change 2020-09-02 16:27:45 +02:00