diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-09-23 13:35:10 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-09-23 22:32:53 +0000 |
commit | 31e86998fbaaa4e82e0c502249671025c587ef50 (patch) | |
tree | 632b25070763766d51bbc2d291b3022f8ec47352 /ui/qt/byte_view_text.cpp | |
parent | 3a85a5eb96aff95b1711961708b863a556d461f1 (diff) |
Qt: Add zoom and column resize actions.
Plumb signals and slots for changing the text size in the main window.
Remove the bold font code from WiresharkApplication. It was only used in
ByteViewText. Adjust the icons a bit.
Bug: When we change the font preferences the packet list stops drawing
cached strings. I haven't been able to track down the cause.
Change-Id: I609d740c9f26265628fa4b7de1b75b0e56651387
Reviewed-on: https://code.wireshark.org/review/4269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/byte_view_text.cpp')
-rw-r--r-- | ui/qt/byte_view_text.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/qt/byte_view_text.cpp b/ui/qt/byte_view_text.cpp index 559dee1bbf..7920b55d52 100644 --- a/ui/qt/byte_view_text.cpp +++ b/ui/qt/byte_view_text.cpp @@ -122,6 +122,14 @@ void ByteViewText::renderBytes() setUpdatesEnabled(true); } +void ByteViewText::setMonospaceFont(const QFont &mono_font) +{ + mono_normal_font_ = mono_font; + mono_bold_font_ = QFont(mono_font); + mono_bold_font_.setBold(true); + renderBytes(); +} + // Private #define BYTE_VIEW_SEP 8 /* insert a space every BYTE_VIEW_SEP bytes */ @@ -285,7 +293,7 @@ void ByteViewText::setState(ByteViewText::highlight_state state) QPalette pal = wsApp->palette(); moveCursor(QTextCursor::End); - setCurrentFont(wsApp->monospaceFont()); + setCurrentFont(mono_normal_font_); setTextColor(pal.text().color()); setTextBackgroundColor(pal.base().color()); @@ -295,7 +303,7 @@ void ByteViewText::setState(ByteViewText::highlight_state state) break; case StateField: if (bold_highlight_) { - setCurrentFont(wsApp->monospaceFont(true)); + setCurrentFont(mono_bold_font_); } else { setTextColor(pal.base().color()); setTextBackgroundColor(pal.text().color()); |