summaryrefslogtreecommitdiffstats
path: root/yakuake/src/title_bar.h
blob: 548347795f2e036e1608761ab76016c4d243860a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/

/*
  Copyright (C) 2005 Francois Chazal <neptune3k@free.fr>
  Copyright (C) 2006-2007 Eike Hein <hein@kde.org>
*/


#ifndef TITLE_BAR_H
# define TITLE_BAR_H

#include "image_button.h"

#include <tqurl.h>
#include <tqcolor.h>
#include <tqpoint.h>
#include <tqbitmap.h>
#include <tqpixmap.h>
#include <tqwidget.h>
#include <tqpainter.h>
#include <tqpushbutton.h>


#include <tdeconfig.h>
#include <tdepopupmenu.h>
#include <tdeapplication.h>
#include <kstandarddirs.h>


class TitleBar : public TQWidget
{
    Q_OBJECT
  

    public:
        explicit TitleBar(TQWidget * parent = 0, const char * name = 0, const TQString & skin = "default");
        ~TitleBar();

        TQRegion& getWidgetMask();

        void setTitleText(const TQString& title);

        void setFocusButtonEnabled(bool enable);

        void setConfigurationMenu(TDEPopupMenu* menu);

        void reloadSkin(const TQString& skin);


    protected:
        virtual void paintEvent(TQPaintEvent*);
        virtual void resizeEvent(TQResizeEvent*);


    private:
        void setPixmaps(const TQString& skin);
        void loadSkin(const TQString& skin);
        void updateWidgetMask();

        /* Widget's mask */
        TQRegion mask;

        /* Text properties */
        TQString title_text;
        TQString skin_text;
        TQColor text_color;
        TQPoint text_position;

        /* Widget's pixmaps */
        TQPixmap back_image;
        TQPixmap left_corner;
        TQPixmap right_corner;

        /* Quit button */
        TQPoint quit_position;
        ImageButton* quit_button;

        /* Focus button */
        TQPoint focus_position;
        ImageButton* focus_button;

        /* Configure button */
        TQPoint config_position;
        ImageButton* config_button;
};

#endif /* TITLE_BAR_H */