aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk/gtk-label.c
AgeCommit message (Collapse)AuthorFilesLines
4 daysGTK: fixed bogus "(Unnamed)" strings in the message lineRobin Haberkorn1-6/+16
* An empty message line would actually contain "(Unnamed)". * Info popups must discern the "(Unnamed)" string (e.g. a file with that name) from the actual unnamed buffer since when clicking the unnamed buffer, you must insert nothing (`EB$`). Therefore, the unnamed buffer is represented as an empty string. "(Unnamed)" is just a placeholder for rendering. This was carried over into TecoGtkLabel which always rendered the empty string as "(Unnamed)". But TecoGtkLabels are used for the info and message lines as well. * Therefore the fallback/placeholder string is now configurable per label. * On the downside, this wastes one more machine word per TecoGtkLabel. The alternative would have been to use {NULL, 0} as the representation for unnamed buffers, so you can actually discern the empty string from the unnamed buffer representation. However it feels wrong to have this kind of info-popup-specific handling in a more generic label widget. Also, for consistency we'd have to touch the Curses UI as well where the unnamed buffer is also currently internally represented by empty strings (as opposed to NULL). * Regression introduced by 0c89fb700957e411885e7e7835e15f441e8b5e84, so it was in v2.5.0.
12 daysupdated copyright to 2026Robin Haberkorn1-1/+1
2025-12-28teco_string_t is now passed by value like a scalar if the callee isn't ↵Robin Haberkorn1-2/+2
expected to modify it * When passing a struct that should not be modified, I usually use a const pointer. * Strings however are small 2-word objects and they are often now already passed via separate `gchar*` and gsize parameters. So it is consistent to pass teco_string_t by value as well. A teco_string_t will usually fit into registers just like a pointer. * It's now obvious which function just _uses_ and which function _modifies_ a string. There is also no chance to pass a NULL pointer to those functions.
2025-12-23fixed clicking the "(Unnamed)" buffer in 0EB popupsRobin Haberkorn1-11/+17
* When constructing the list of popup items, the unnamed buffer is stored as the empty string instead of a prerendered "(Unnamed)". Using the empty string simplifies autocompletions, which will actually have to insert nothing at all (in addition to terminating the string). * Since unnamed buffers are now special in the popup list, we can render them with special icons as well. Currently, only on Curses we use a file symbol with a question mark. There doesn't appear to be a fitting standard Freedesktop icon to use on GTK and there isn't even any fitting standard emblem to lay over the default file icon.
2025-08-28bumped minimum Gtk version to 3.24Robin Haberkorn1-2/+0
* Gtk 3.24 has been introduced accidentally in 9e3746a4 due to GtkEventControllerScroll. * It would be possible to still support v3.12 by partially reversing 9e3746a4 and conditionally including teco_interface_scroll_cb(). But it's probably not worth the trouble.
2025-07-31implemented ^T command: allows typing by code and getting characters from ↵Robin Haberkorn1-0/+24
stdin or the user * n:^T always prints bytes (cf. :^A) * ^T without arguments returns a codepoint or byte from stdin. In interactive mode, this currentply places a cursor in the message line and waits for a keypress.
2025-02-23support mouse interaction with popup windowsRobin Haberkorn1-0/+6
* Curses allows scrolling with the scroll wheel at least if mouse support is enabled via ED flags. Gtk always supported that. * Allow clicking on popup entries to fully autocomplete them. Since this behavior - just like auto completions - is parser state-dependant, I introduced a new state method (insert_completion_cb). All the implementations are currently in cmdline.c since there is some overlap with the process_edit_cmd_cb implementations. * Fixed pressing undefined function keys while showing the popup. The popup area is no longer redrawn/replaced with the Scintilla view. Instead, continue to show the popup.
2025-01-13updated copyright to 2025Robin Haberkorn1-1/+1
2024-01-21updated copyright to 2024Robin Haberkorn1-1/+1
2023-05-14resolved warning in gtk-label.c due to wrong enum typeRobin Haberkorn1-1/+1
* This probably did not cause any bugs.
2023-04-05updated copyright to 2023Robin Haberkorn1-1/+1
2022-06-21updated copyright to 2022 and updated TODORobin Haberkorn1-1/+1
2021-06-08get rid of the GObject Builder (GOB2): converted teco-gtk-info-popup.gob and ↵Robin Haberkorn1-0/+271
teco-gtk-label.gob to plain C * Using modern GObject idioms and macros greatly reduces the necessary boilerplate code. * The plain C versions of our GObject classes are now "final" (cannot be derived) This means we can hide the instance structures from the headers and avoid using explicit private fields. * Avoids some deprecation warnings when building the Gtk UI. * GOB2 is apparently no longer maintained, so this seems like a good idea in the long run. * The most important reason however is that there is no precompiled GOB2 for Windows which prevents compilation on native Windows hosts, eg. during nightly builds. This is even more important as Gtk+3 is distributed on Windows practically exclusively via MSYS. (ArchLinux contains MinGW gtk3 packages as well, so cross-compiling from ArchLinux would have been an alternative.)