mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +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"
|
#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)
|
CSVWidget::SceneToolbar::SceneToolbar (int buttonSize, QWidget *parent)
|
||||||
: QWidget (parent), mButtonSize (buttonSize), mIconSize (buttonSize-6)
|
: QWidget (parent), mButtonSize (buttonSize), mIconSize (buttonSize-6)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,10 @@ namespace CSVWidget
|
|||||||
int mButtonSize;
|
int mButtonSize;
|
||||||
int mIconSize;
|
int mIconSize;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void focusInEvent (QFocusEvent *event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SceneToolbar (int buttonSize, QWidget *parent = 0);
|
SceneToolbar (int buttonSize, QWidget *parent = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user