From b8201aef9d3375dfaaa31aa00ea4686d91c2cf03 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 12 Jun 2016 16:07:30 -0700 Subject: Qt: Main window tab behavior. Make the main window tab order more closely match the GTK+ UI. Draw a focus rect in the byte view text while we're here. Change-Id: I04212c14ea7f0d6865b709533246760adc02f45a Reviewed-on: https://code.wireshark.org/review/15862 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte Reviewed-by: Gerald Combs --- ui/qt/byte_view_text.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui/qt/byte_view_text.cpp') diff --git a/ui/qt/byte_view_text.cpp b/ui/qt/byte_view_text.cpp index d010d86cdb..eca8360482 100644 --- a/ui/qt/byte_view_text.cpp +++ b/ui/qt/byte_view_text.cpp @@ -85,6 +85,10 @@ ByteViewText::ByteViewText(QWidget *parent, tvbuff_t *tvb, proto_tree *tree, QTr connect(format_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setHexDisplayFormat(QAction*))); setMouseTracking(true); + +#ifdef Q_OS_MAC + setAttribute(Qt::WA_MacShowFocusRect, true); +#endif } ByteViewText::~ByteViewText() @@ -211,6 +215,10 @@ void ByteViewText::paintEvent(QPaintEvent *) row_y += line_spacing_; } painter.restore(); + + QStyleOptionFocusRect option; + option.initFrom(this); + style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this); } void ByteViewText::resizeEvent(QResizeEvent *) -- cgit v1.2.1