~ubuntu-branches/ubuntu/warty/kdebase/warty

« back to all changes in this revision

Viewing changes to kcontrol/style/menupreview.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-09-16 04:51:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040916045145-9vr63kith3k1cpza
Tags: upstream-3.2.2
ImportĀ upstreamĀ versionĀ 3.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: menupreview.h,v 1.2 2002/03/01 14:46:39 danimo Exp $
 
3
 *
 
4
 * Menu Transparency Preview Widget
 
5
 * Copyright (C) 2002 Karol Szwed <gallium@kde.org>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public
 
9
 * License version 2 as published by the Free Software Foundation.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; see the file COPYING.  If not, write to
 
18
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifndef __MENUPREVIEW_H
 
23
#define __MENUPREVIEW_H
 
24
 
 
25
#include <qwidget.h>
 
26
 
 
27
class KPixmap;
 
28
 
 
29
class MenuPreview : public QWidget
 
30
{
 
31
        Q_OBJECT
 
32
 
 
33
public:
 
34
        enum PreviewMode {
 
35
                NoEffect = 0,
 
36
                Tint,
 
37
                Blend 
 
38
        };
 
39
 
 
40
        MenuPreview( QWidget* parent, int opacity, PreviewMode pvm );
 
41
        ~MenuPreview();
 
42
 
 
43
public slots:
 
44
        void setOpacity( int opacity );
 
45
        void setPreviewMode( PreviewMode pvm );
 
46
 
 
47
protected:
 
48
        void paintEvent( QPaintEvent* pe );
 
49
 
 
50
private:
 
51
        void createPixmaps();
 
52
        void blendPixmaps();
 
53
 
 
54
        KPixmap* pixBackground;
 
55
        KPixmap* pixOverlay;
 
56
        KPixmap* pixBlended;
 
57
        float menuOpacity;
 
58
        PreviewMode mode;
 
59
};
 
60
 
 
61
// vim: set noet ts=4:
 
62
#endif // __MENUPREVIEW_H
 
63