mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 21:42:13 +00:00
when scene toolbar gains focus, focus first button
This commit is contained in:
parent
c2ea8f3f0a
commit
688d413b8c
@ -5,6 +5,14 @@
|
||||
|
||||
#include "scenetool.hpp"
|
||||
|
||||
void CSVWidget::SceneToolbar::focusInEvent (QFocusEvent *event)
|
||||
{
|
||||
QWidget::focusInEvent (event);
|
||||
|
||||
if (mLayout->count())
|
||||
dynamic_cast<QWidgetItem&> (*mLayout->itemAt (0)).widget()->setFocus();
|
||||
}
|
||||
|
||||
CSVWidget::SceneToolbar::SceneToolbar (int buttonSize, QWidget *parent)
|
||||
: QWidget (parent), mButtonSize (buttonSize), mIconSize (buttonSize-6)
|
||||
{
|
||||
|
@ -17,6 +17,10 @@ namespace CSVWidget
|
||||
int mButtonSize;
|
||||
int mIconSize;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void focusInEvent (QFocusEvent *event);
|
||||
|
||||
public:
|
||||
|
||||
SceneToolbar (int buttonSize, QWidget *parent = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user