Dax89 / QHexView

A versatile Hexadecimal widget for Qt5
MIT License
321 stars 102 forks source link

support change font size using setFont(...) #55

Closed shinespeciall closed 2 years ago

shinespeciall commented 3 years ago

currently using this can only change the font size but the rendered lines' position in the widget are fixed

hexview->setFont(QFont("Timers", 8, QFont::Bold)); image

Dax89 commented 3 years ago

I have made some changes, let me know if it works!

shinespeciall commented 3 years ago

it works, thanks for the quick fix ! image

aerosoul94 commented 3 years ago

@shinespeciall How did you make 00 and FF bytes the same color?

shinespeciall commented 3 years ago

i think that is cused by the phantomstyle theme i am using or the palette settings for the whole project: phantomstyle: https://github.com/randrew/phantomstyle/tree/master custom color in the project: https://github.com/wario-land/WL4Editor/blob/chunk_editor/Themes.h reset the project's UI palette: https://github.com/wario-land/WL4Editor/blob/chunk_editor/WL4EditorWindow.cpp#L41

wait, it didn't happen when i implement the hexview at first, so the reason should be elsewhere. idk, at first, i test the hexview in a way provided by the readme file in this repo (it looks like the first pic in this issue), but now i put a QFrame in the ui file and promote it to the hexview, then it looks like the second pic in this issue. (the details are in chunk_editor branch atm) i just commented out the setFont code but the FF and 00 still remain the modified style, so perhaps it is caused by the subclassing and the theme and palette settings?

Dax89 commented 3 years ago

00 and FF bytes' color are changed here:

https://github.com/Dax89/QHexView/blob/master/document/qhexrenderer.cpp#L218