New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement: cut down the space wasted in sidebar #1711
Comments
"Markdown Preview" is an especially bad offender, I might have to change that to just "Preview" some day. |
@codebrainz or just "MP" 😁 |
Well, apart from "Symbols" and "Documents" which we could abbreviate "Sym" and "Doc", all the tabs are from plugins, which have separate authors, and they may not be as agreeable as @codebrainz to cut their titles. |
umm so the changes must be done in each plugin? ok but must be an api and base to geany display that names, i think in that base of code just take the label and cut done to only 3 letters or only initials.. well so for a while i know where to start to adapt my installation/packages.. its a great community thanks |
Geany core could iterate the tabs and if they contain label widgets, truncate/ellipsize their label text to a preset width. It wouldn't be very hard. |
It would need to be a setting of number of, erm, bytes?, code points?, glyphs?, ems?, pixels?, mm? and of course a setting to leave the damn things alone. And translations? |
@elextr may have right, translations could be a problem, but if @codebrainz are in right direction and as i suspect, translation will be cut down i cannot find where can be that, @codebrainz you said that dont be hard.. i'm not expert in GTK but i know something C, some started point? |
@mckaygerhard the point of the long list of how to determine the length on tabs is that once you move beyond ASCII into other languages none of those simple methods work. Translations mean you don't know what the tab is called. A fixed number of bytes is no good, it might fall in the middle of a multi-byte code point in some non-english language. Even a fixed number of code points won't work due to combining characters which mean two code points is one glyph, and not all glyphs are the same size so a fixed number of them may not work for some languages. So you are left with physical sizes, although you can cut glyphs off so its not as nice, and fixed number of pixels means you are prey to monitor resolutions, and won't change with font sizes or zooming. Using mm avoids the monitor resolution issues but not font sizes or zoom, ems helps that further, but its all now becoming awfully complicated, and who knows if the GTK tab widgets can be controlled in that way, they do not seem to have a |
@elextr so then thanks to you clarifications, "for now" i can hardcoded my ide's compilations cutting that letters while i waith for this issue feature resolution, avoiting load tranlations (in my environment only russian and english are apart of spanish, no right to left langs are used) |
By not very hard I meant something like this: gint n = gtk_notebook_get_n_pages(nb);
for (gint i=0; i < n; n++)
{
GtkWidget *wid = gtk_notebook_get_tab_label(nb,
gtk_notebook_get_nth_page(i));
if (GTK_IS_LABEL(wid))
{
gtk_label_set_ellipsize(GTK_LABEL(wid), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars(GTK_LABEL(wid),
interface_prefs.sidebar_tab_label_width);
}
} It should work fine with the normal (UTF-8) text that's in the tab labels, and has no impact on translations. |
I would think you could connect a callback function to the sidebar notebook's |
IMO, just a setting that is the number of chars to truncate at (as defined by Pango), and if set to zero (default), no truncation occurs. |
@codebrainz yeah, if pango is doing the elipsizing then it might be ok, since its aware of all the language issues. |
hello friends @codebrainz and @elextr , what its the progress on that issue, and how i can made it manully for normal direction languajes, i just only cut down to 4 leterrs those tabas in some older versions that used GTK 2.18 and GLIB 2.24 i tried the code proposed by @elextr but no sucess and get many errors.. |
the code proposed by @codebrainz I think you mean.
AFAIK nobody is working on it, somebody who is interested needs to provide a pull request. |
hi! i'm interesting in this for my own purposes.. i want just a simple patch.. just cut down first 3 letters.. in witch part of code must be done? @elextr ? @codebrainz ? @mckaygerhard ? i'm not xpert in c! help! |
i guess: search at the code |
the geany sidebar are arrange by tabas.. but cannot be reordened and
if there more thant 3 tabs the vision are limited of thems due labels of each are too large
and if the sidebar are in vertical/horizontal there a waste of space
my suggestion its to optionally only show 3 firts letters or icon only like does with normal tool bar
i'm particular want to know how to only load 3 firts letters to cheap the space in small screen
The text was updated successfully, but these errors were encountered: