question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add options to hide some tools in toolbar

See original GitHub issue

When using the viewer with a small width, the toolbar might be too wide.

Hiding some tools will make it lighter, but in order to still be able to use them if necessary, I would suggest 3 states:

  • hidden: the tool is not visible on the bar;
  • visible: the tool is not visible on the bar;
  • collapsed: the tool is moved in the More dropdown list;

I’m not sure what is the best way to do it. Maybe adding two more options that use tools identifiers in arrays:

const options = {
    // ...
    hide_tools: ['ortho', 'explode', 'axes0', 'pin_view'],
    collapse_tools: ['axes', 'grid', 'transparent', 'black_edge', 'explode', 'help']
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
bernhard-42commented, Mar 31, 2022

Given the analysis in https://github.com/roipoussiere/cadquery-vscode/issues/2 I will not further dig into this. 1.5.6 has the requested trimUI functionality, however your extension needs to deal with the asynchronism of DOM handling.

1reaction
bernhard-42commented, Mar 29, 2022

I have added a function to the next release to selectively enable/disable elements in the tollbar:

Disable:

viewer.trimUI(["axes", "axes0", "grid", "ortho", "more"], false)

Enable:

viewer.trimUI(["axes", "axes0", "grid", "ortho", "more"], true)

Now you can easily go down to width of 400px

image

Since you have to create the viewer component in the web view of VS Code, you should be able to call this function, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize toolbars on Mac - Apple Support
Hide or show the toolbar: Choose View > Hide Toolbar or View > Show Toolbar. While working in full screen for some apps,...
Read more >
Customize the Quick Access Toolbar - Microsoft Support
Customize the Quick Access Toolbar by using the Options command. You can add, remove, and change the order of the commands on the...
Read more >
Toolbar for HIDDEN TOOLS? Check Out the Mr Hide ...
In this video, check out Mr Hide - an extension for SketchUp designed to give you quick access to the hidden or difficult...
Read more >
can you hide the Toolbar Options (add and remove buttons)
On the ultratoolbarmanager - there is a Down arrow (highlighted it says toolbar options - and the text Add and remove buttons.
Read more >
How do I hide a menu item in the actionbar? - android
So use onCreateOptionsMenu to create the menu and onPrepareOptionsMenu to change visibility etc. Share.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found