~blue-shell/blue-shell/kde-workspace-systemsettings-qml

« back to all changes in this revision

Viewing changes to systemsettings/qml/FocusRect.h

  • Committer: Eike Hein
  • Date: 2013-01-23 10:25:54 UTC
  • Revision ID: git-v1:cd6b36487ddc7ef8ff77defcc4ae40bb0c2e89ab
Basic QML Testbed view mode plugin.

Missing wip feature branches for:
- keyboard nav and associated scroll behavior
- item rect animations
- search filtering
- CJK-optimized label wordwrapping
- rtl layout experiments

To be finished/merged one by one soon.

Known bugs:
- scrollbar doesn't update on first show (minor)
- doesn't follow the single vs. doubleclick global setting
- whole bunch of hardcoded margins making for ugly code (mostly
  addressed in the rtl branch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /**************************************************************************
 
2
 * Copyright (C) 2012 Eike Hein <hein@kde.org>                            *
 
3
 *                                                                        *
 
4
 * This program is free software; you can redistribute it and/or          *
 
5
 * modify it under the terms of the GNU General Public License            *
 
6
 * as published by the Free Software Foundation; either version 2         *
 
7
 * of the License, or (at your option) any later version.                 *
 
8
 *                                                                        *
 
9
 * This program is distributed in the hope that it will be useful,        *
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 
12
 * GNU General Public License for more details.                           *
 
13
 *                                                                        *
 
14
 * You should have received a copy of the GNU General Public License      *
 
15
 * along with this program; if not, write to the Free Software            *
 
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA          *
 
17
 * 02110-1301, USA.                                                       *
 
18
***************************************************************************/
 
19
 
 
20
#include <QDeclarativeItem>
 
21
 
 
22
class FocusRect : public QDeclarativeItem
 
23
{
 
24
    Q_OBJECT
 
25
    Q_PROPERTY( bool focused READ focused WRITE setFocused )
 
26
 
 
27
    public:
 
28
        FocusRect( QDeclarativeItem *parent = 0 );
 
29
 
 
30
        bool focused() const;
 
31
        void setFocused( bool hovered );
 
32
 
 
33
        void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
 
34
 
 
35
    private:
 
36
        bool m_focused;
 
37
};