Comments (5)
We need to do something in styleplugin/basestyle.cpp
m.topMargin = 2; // static_cast<int>(fontHeight * MenuItem_VerticalMarginsFontRatio);
m.bottomMargin = 2; // static_cast<int>(fontHeight * MenuItem_VerticalMarginsFontRatio);
This seems to fix the menu item height.
Although we might want to hardcode the menu item height to an exact number of pixels instead of calculating it based on the font size; especially if we hardcode the absolute pixel height of the MainWindow that contains the menu. However, keep in mind that for non-global menus different font sizes and hence different menu item heights may be desirable.
For the menu(bar) height we need to change:
case CT_MenuBarItem: {
return QSize(size.width() + 10, 22);
}
This hardcodes the height to 22px. Note that this value should always be kept the same as the height of the MainWindow of the Menu application. Can we make the MainWindow of the Menu application find out the height of the CT_MenuBarItem and just use that?
Text is still not centered.
from qtplugin.
Addressing this in 8db9bf2 and in helloSystem/Menu@6619aed
from qtplugin.
Defined by:
- QtPlugin
CT_MenuBarItem
(in helloSystem, we want 22px) - QtPlugin
- QtPlugin
CT_MenuBarItem
(in helloSystem, we want 22px/2) - QtPlugin
MenuBar_ItemSpacing
(in helloSystem, we want close to 0px) - QtPlugin
MenuItemMetrics
totalHeight
(in helloSystem, we want this depending on the font size; for the main menu we want 22px) - Menu
MainWindow
height
from qtplugin.
Turns out we get different rendering of text in Debian vs. FreeBSD; the reason for this is not clear yet. Using an ugly ifdef for now: 02361ce
from qtplugin.
Also noteworthy: The Nimbus Sans in Debian/Ubuntu (fonts-urw-base35) behaves very differently than the Nimbus Sans from https://github.com/ArtifexSoftware/urw-base35-fonts/archive/20200910.zip. When using the latter in both places, I get consistent results. Hence closing.
from qtplugin.
Related Issues (20)
- Get rid of extra line around non-selected list item HOT 1
- Make button selected via keyboard visible by changing its outline color HOT 5
- Enable MacKeyboardScheme, make QKeySequence::StandardKey behave like on the Mac HOT 4
- Make Qt behave more like on the Mac
- Do not show icons in menus except if specifically requested
- Consider switching to "proper" scroll bars
- Slows down menus when switching between Falkon windows
- Causes Falkon rendering issues HOT 2
- Text looks too high HOT 8
- Shrink PanelButtonTool
- Add accessibility features HOT 3
- pagination bar design
- Video playlist: Solutions for Styling Qt Widgets
- Do not hardcode the font size for buttons
- [CMake] Get it to build for Qt6, too HOT 1
- Give the window a thin border HOT 1
- Darken window background color
- Port to Qt6 HOT 1
- Missing icons in second and subsequent Falkon windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtplugin.