jun7 / rox-filer

ROX file manager
24 stars 6 forks source link

autoresize too narrow if toolbar without icons #204

Closed step- closed 4 years ago

step- commented 4 years ago

Hello, My toolbar is set to show text only, no icons, and the item count, and the window is set to auto-resize. Rox displays the window too narrow, so some toolbar labels on the right side and the item count are cut off. I think this is a bug, let me know your thinking. Thank you.

jun7 commented 4 years ago

Hi Is Options > Filer windows > Tools/Minibuffer > width of toolbar sets minimum width of window ON ?

The calculation of width is not rightness. So something broken?

step- commented 4 years ago

Yes, it is ON, see pictures. Something is broken. First open folder is OK: it shows SMALL icons and whole toolbar (CORRECT).

Move down to folder with few icons:

Move up to the previous folder

Thank you

rox-20200201-001 rox-20200201-002 rox-20200201-003 rox-20200201-004

jun7 commented 4 years ago

I changed options to your pics but not reproduced. Does It happen even with [text only] -> [icons only]? Any other conditions?

step- commented 4 years ago

Does It happen even with [text only] -> [icons only]? No.

Any other conditions? The attached file is all that I can think of.

rox.tar.gz

jun7 commented 4 years ago

Hmm, not reproduced. Does it happen without the .mo?

step- commented 4 years ago

Does it happen without the .mo? Yes it does, I just tried.

step- commented 4 years ago

I think I know why you can't reproduce: it depends on the theme. I've been using mine for so long that I forgot I had customized it for rox (#156). You should be able to reproduce if you add the following lines to your gtk2 theme file (.gtkrc-mine or similar):

# http://rox.sourceforge.net/desktop/book/export/html/98.html
# https://github.com/jun7/rox-filer/issues/156
# Deleting everything between the braces resets to theme default values.
style "rox-toolbar-lbl" = "default"
{
fg[NORMAL]   = "#4e81c6"
fg[PRELIGHT] = "#4e81c6"
fg[ACTIVE]   = "#4e81c6"
}
style "rox-toolbar-btn-lbl" = "rox-toolbar-lbl"
{
font_name = "DejaVu Sans 16"
}
widget "rox-filer.*.GtkToolbar.GtkButton.*.GtkLabel" style "rox-toolbar-btn-lbl"
widget "rox-filer.*.GtkToolbar.GtkLabel" style "rox-toolbar-lbl"

If I comment out the last two lines and run rox -n the toolbar isn't cut off anymore. I suppose the current code calculates toolbar width based on a smaller font-size: my system font size is 10pt, I only change it for the rox toolbar.

jun7 commented 4 years ago

Reproduced! I will fix it.

step- commented 4 years ago

Thank you!

jun7 commented 4 years ago

Thank you for reporting!

jun7 commented 4 years ago

Ah label is cut off. Sorry I will fix it.

step- commented 4 years ago

Yes I was just testing it and it's better but there are still cases when the toolbar is cut off. When I change folder from small icon view (many items) going to large icon view (few items) the toolbar shrinks too much and cuts off some buttons.

jun7 commented 4 years ago

Not reproduced. Any other conditions?

step- commented 4 years ago

With the .mo

step- commented 4 years ago

Only with the .mo

jun7 commented 4 years ago

Hmm. The width of toolbar is calculated once when toolbar is created. So If the bug is in the calculation, changing folder is not matter. Does It happen only with changing folder from small to large?

jun7 commented 4 years ago

Ah I get it. You have to add '┼' to N_("Size┼"). rox calculates width without '┼' and then added. The width of items depend on max width. So it is serious.

step- commented 4 years ago

Are you testing with the gtk2 styles that I mentioned previously? If you do you will see the issue more clearly, because the font size is much bigger in those styles, so a calculation error is magnified.

step- commented 4 years ago

The width of items depend on max width. Yes, I can see that when I hover the pointer over each button: they're all the same size large enough to for 'Size┼'.

step- commented 4 years ago

One more question, maybe a new issue. With Options > Tools/Minibuffer > Toobar type: Icons only & Show totals of items ON, sometimes the total of items isn't shown because the window shrinks too much. Changing folders can bring the item count back into view. Has anything like this happened to you before? Is it correct?

jun7 commented 4 years ago

Does it happen with HEAD(6bbef70700228fb3c81d6751fa40cc80a1d82017) ?

step- commented 4 years ago

Thanks for the message. I hadn't thought about checking commits. I just built and tested 6bbef70. It's much better now but not quite fixed. The last icon and the item counts are still cut off.

AUTOMATIC

rox-20200203-003

AUTOMATIC

rox-20200203-004

MANUAL -- I resized to show whole toobar

rox-20200203-005

jun7 commented 4 years ago

Changing a toolbar option(e.g. Show totals of items) re-calculate toolbar width. So could you check the result of changing it on a dir having few folders or empty?

step- commented 4 years ago

Yes, good, changing a toolbar option recalculates width and all icons then come into view!

jun7 commented 4 years ago

So the calculation is now OK. The width of the toolbar is narrow than the picts you post? Then the size chars are suspect. If not, Hmm I have no idea.

step- commented 4 years ago

I'm not sure if you are asking something new. The width of the toolbar can be like any of the three pictures I posted. It depends on what rox wants to show. When rox resizes the toolbar too narrow the last icon and the item counts are out of view, cut off.

step- commented 4 years ago

This with the .mo but without gtk styles always shows all buttons (but item count is still out of view)

rox-20200204-002

jun7 commented 4 years ago

You said that not fixed. So I want to know whether the calculation is OK or not. Since the calculation is OK, there is another problems making windows narrow. Isn't it fixed with reboot or changing dir?

step- commented 4 years ago

Not fixed with reboot or changing dir. Problem is fixed when no gtk style. See the last picture I posted. Problem not fixed when gtk style. Maybe depend on char size in gtk style property?

jun7 commented 4 years ago

Hmm the caluculation is not OK? Changing toolbar options with gtk style makes same result?

jun7 commented 4 years ago

Make sure that when changed gtk theme, reboot rox. the gtk_widget_size_request that used to get width of widgets not returns proper size without reboot.

step- commented 4 years ago

I don't know if the calculation is OK or not. I don't know what the calculation does. Changing toolbar options with gtk style makes all buttons visible TEMPORARILY until I change the folder and then buttons are cut off again.

step- commented 4 years ago

Make sure that when changed gtk theme, reboot rox. the gtk_widget_size_request that used to get width of widgets not returns proper size without reboot.

Ah, sorry for not rebooting rox before. Now I did. Then problem is not fixed when no gtk style. With or without gtk style problem is the same: buttons out of view.

jun7 commented 4 years ago

Could you post a pict of the result of changing options?

step- commented 4 years ago

Sure. With .mo and no gtk theme.

BEFORE

rox-20200204-004

rox-20200204-003

AFTER

rox-20200204-007

rox-20200204-006

jun7 commented 4 years ago

You have to add '┼' to N_("Size┼") for the caluclation.

step- commented 4 years ago

Which calculation? I didn't need to do any calculation.

jun7 commented 4 years ago

For the width of the toolbar. You can see buttons of the pict (rox-20200204-006) are narrow because it lacks '┼'.

step- commented 4 years ago

Yes, I understand. But I don't understand what you want me to do. I did not need to do any calculations. Nothing I can do to calculate the width of the toolbar, sorry. rox-20200204-003-006

step- commented 4 years ago

Maybe I understand. You mean changing the .mo? If you want to test a different .mo you can easily build one from the one I sent you. Wait...

step- commented 4 years ago

msgunfmt < ROX-Filer.mo > test.po vim test.po msgfmt -o test.mo test.po

step- commented 4 years ago

Inside my .mo there are two lines:

msgid "Size"
msgstr "🌑"

msgid "Size┼"
msgstr "🌑"

The first one matches when your _N is "Size" the second one matches when your _N is "Size┼" They both return "🌑" because you append different characters after "Size". If your code can define different _N("Size"+character) for all appended characters then I can change the .po.

jun7 commented 4 years ago

I could not understand why both return "🌑". So just change the bottom of "🌑" to "🌑┼".

step- commented 4 years ago

Ah, right, you already changed the _N in 6bbef70 -- I hadn't seen that commit. Good. ... Yes, I changed "🌑" to ""🌑┼" in .mo and now all buttons are visible! Good!

Only last thing: sometimes item count is not visible. I think it happens when the string ends with
"(n hidden)". In my Options > Filer windows > New window > show hidden files is OFF.

jun7 commented 4 years ago

It is normal. Calculating the width of information label every time is not planned.

step- commented 4 years ago

Calculating the width of information label every time is not planned. OK.

Does rox not calculate the information label when a new window opens? Because when I start rox in $HOME from shell prompt, rox never shows info label, and $HOME has many hidden folders.

jun7 commented 4 years ago

Only when a new window opens makes no sense. If you want more wider window you can change the base information string that I added by 6bbef70700228fb3c81d6751fa40cc80a1d82017 as you do tool labels.

step- commented 4 years ago

Only when a new window opens makes no sense.

Agreed.

If you want more wider window

I don't.

I want the window to be wide enough to show the info label. Currently the window is too narrow therefore it doesn't show the info label. I have to resize the window manually to view the info label. Is that normal? When the window resizes automatically, some times is cuts off the info label again. Is that normal?

step- commented 4 years ago

Thank you very much for fixing #204 and all your patience and support! I think you can close this issue (resolved). To discuss about item count I have opened #207.

Thank you again