Skip to content
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

Allow Strings' columns to be resized (#2711) #2720

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

A0su
Copy link

@A0su A0su commented Jul 14, 2021

Your checklist for this pull request

Detailed description

I began by comparing the current release of Cutter that I am using to v1.9 as mentioned in the issue to see what the missing functionality looked like. After experimenting with resizeSections() and setSectionResizeMode() and googling about stretched and interactive columns in Qt I arrive at my current solution.

Before (v1.11):
before
After:
after

The only issue I can see is that on startup the columns aren't spaced the same in v11.1 where the Strings column is stretched. Should this also be incorporated into this fix?

Closing issues
Closes #2711

@xarkes
Copy link
Member

xarkes commented Jul 15, 2021

Hello, thanks for the contribution!
Indeed it would be better if everything is resized to contents at first and to allow resizing as well.
It'd be great if you can find the proper setting to do so :)

@xarkes
Copy link
Member

xarkes commented Sep 14, 2021

What should we do with this? It's indeed nice to be able to resize the columns, however I'm not sure if the current implementation is better than the fixed sized columns we had before.

@A0su
Copy link
Author

A0su commented Sep 14, 2021

I can try to get the fix out within the next week; sorry have been busy with school lately. To clarify the implementation should present the interface as it does now but also support resizing, correct?

@xarkes
Copy link
Member

xarkes commented Sep 15, 2021

I believe that would be the best, yes!

@thestr4ng3r thestr4ng3r changed the base branch from master to dev December 21, 2021 12:42
@@ -214,10 +214,8 @@ StringsWidget::StringsWidget(MainWindow *main)
});

auto header = ui->stringsTreeView->header();
header->setSectionResizeMode(QHeaderView::ResizeMode::ResizeToContents);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also works when just changing this line to "header->resizeSections(QHeaderView::ResizeMode::ResizeToContents);"

@ITAYC0HEN
Copy link
Member

unless specifying maximum-length at start, it can be risky as some strings can be VERY long an the column resizer will be far far to the right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't resize columns width in Strings window
5 participants