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

[Gui] Add hidden pref to lock toolbars #4992

Merged
merged 3 commits into from Oct 8, 2021

Conversation

chennes
Copy link
Member

@chennes chennes commented Aug 24, 2021

When arranged vertically, the bar that allows the dragging of toolbars can cause problems with the toolbar appearance. This adds a hidden preference that controls whether the toolbars are movable. This exists primarily to assist theme designers, and forms part of a larger set of changes adding hidden preferences to control various aspects of the GUI to allow more control over FreeCAD's appearance.


@luzpaz luzpaz added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD awaiting review labels Aug 24, 2021
When arranged vertically, the bar that allows the dragging of toolbars
can cause problems with the toolbar appearance. This adds a hidden
preference that controls whether the toolbars are movable.
@carlopav
Copy link
Contributor

Compiled and tested, works really good to me.
It is effective on every standard toolbar. Unluckly it does not affect the custom Draft Toolbars. I think this is not a problem of this PR but rather of how the "Draft Snap" and the "Draft Tray" are coded...
May I ask if we can have a Gui command to lock the toolbars while the program is running, without the need to restart? Something like "Std_LockToolbars" or "Std_ToggleToolbarsLock"?

@chennes
Copy link
Member Author

chennes commented Aug 29, 2021

Compiled and tested, works really good to me.
It is effective on every standard toolbar. Unluckly it does not affect the custom Draft Toolbars. I think this is not a problem of this PR but rather of how the "Draft Snap" and the "Draft Tray" are coded...

I can address that in this PR by adding code to Draft that checks for this hidden parameter when it creates its toolbars. I don't like that any other Python workbench that adds toolbars would have to do the same thing, though. But I cannot see a way around it as things are currently structured: there is no signal emitted when a toolbar is added, that I can find, so I can't think of a good way to enforce this behavior.

May I ask if we can have a Gui command to lock the toolbars while the program is running, without the need to restart? Something like "Std_LockToolbars" or "Std_ToggleToolbarsLock"?

I suggest submitting that as a feature request ticket, it should be possible without too much trouble.

@carlopav
Copy link
Contributor

I can address that in this PR by adding code to Draft that checks for this hidden parameter when it creates its toolbars. I don't like that any other Python workbench that adds toolbars would have to do the same thing, though.

I agree, perhaps I can find a way to turn those toolbars into standard ones... I'd suggest to leave this PR like this, but i'd like if we could continue this discussion here: https://forum.freecadweb.org/viewtopic.php?f=23&t=61715&p=528537#p528537

I suggest submitting that as a feature request ticket, it should be possible without too much trouble.

Ok, thanks!

@yorikvanhavre
Copy link
Member

I understand you want to add more commits to this PR, @chennes ? Or do you prefer to merge it as is?

@chennes
Copy link
Member Author

chennes commented Aug 30, 2021

I understand you want to add more commits to this PR, @chennes ? Or do you prefer to merge it as is?

Sorry for the confusion - this PR is done and ready, but there will be more in this series.

@berndhahnebach
Copy link
Contributor

would you rebase to make CI passing ... https://gitlab.com/berndhahnebach/FreeCAD/-/pipelines/376366855

@berndhahnebach
Copy link
Contributor

would you rebase the PR to make it run on CI?

@carlopav
Copy link
Contributor

would you rebase the PR to make it run on CI?

Not yet, let me update it before as requested, not necessary to compile it now (same for the others PR where you asked). Let me know if compiling is necessary for some other tests of yours :)

@berndhahnebach
Copy link
Contributor

Following a link to the branch on the CI-repository:

https://gitlab.com/berndhahnebach/FreeCAD/-/commits/PR_5060

The CI-status is available on the latest commit of the branch.
If there is no status available the PR should be rebased on latest master.
Check pipeline branches to see if your PR has been run by the CI.

https://gitlab.com/berndhahnebach/FreeCAD/-/pipelines?scope=branches

@berndhahnebach
Copy link
Contributor

@chennes chennes merged commit 010f168 into FreeCAD:master Oct 8, 2021
@chennes chennes deleted the hiddenPrefToLockToolbars branch October 8, 2021 22:47
kadet1090 added a commit to kadet1090/FreeCAD that referenced this pull request Nov 30, 2023
This adds the Std_ToggleToolBarLock action mentioned in FreeCAD#4992. It is
exposed in the context menu of toolbar and also in the view -> toolbars
app menu.
wwmayer pushed a commit that referenced this pull request Dec 1, 2023
This adds the Std_ToggleToolBarLock action mentioned in #4992. It is
exposed in the context menu of toolbar and also in the view -> toolbars
app menu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants