aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/notifier/settingsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/General/notifier/settingsdialog.cpp')
0 files changed, 0 insertions, 0 deletions
19:39:47 +0000 added shaded mode for the playlist window' href='/qmmp/commit/src/playlisttitlebar.cpp?id=bdfdce7315b4db7b6d2a5c8f3ce418a747dfc9c6'>bdfdce731
97c98d9d5
43ee25ac7
2d622fd9b
7c3e4b704
1e7a7fdfd
2d622fd9b


26da2f9c1
2d622fd9b


11b7655bb

bdfdce731

11b7655bb

ecc137abe
97c98d9d5
2d622fd9b


1e7a7fdfd
26da2f9c1
1e7a7fdfd
97c98d9d5
26da2f9c1
bdfdce731
97c98d9d5



bdfdce731
ae75e5707
fa1e4194b

bdfdce731

013ee07b5
26da2f9c1
97c98d9d5
2d622fd9b



bdfdce731
ae75e5707
fa1e4194b

bdfdce731

97c98d9d5
2d622fd9b
97c98d9d5
87dbe6b33
97c98d9d5

bdfdce731
97c98d9d5






2d622fd9b

bdfdce731


97c98d9d5
bdfdce731




2d622fd9b

bdfdce731
97c98d9d5
bdfdce731
2d622fd9b
bdfdce731
97c98d9d5
bdfdce731


97c98d9d5

2d622fd9b
2d622fd9b


bdfdce731
97c98d9d5
bdfdce731
2d622fd9b
bdfdce731
97c98d9d5
bdfdce731


97c98d9d5

2d622fd9b
bdfdce731


e13b8ee11



97c98d9d5
bdfdce731

e13b8ee11
97c98d9d5
2d622fd9b




97c98d9d5
2d622fd9b
97c98d9d5

97c98d9d5
87dbe6b33
2d622fd9b



bdfdce731
2d622fd9b
bdfdce731
bdfdce731
97c98d9d5
bdfdce731
013ee07b5
97c98d9d5
bdfdce731
bdfdce731
bdfdce731
bdfdce731

2d622fd9b



97c98d9d5
11b7655bb
c1e29becb
2d622fd9b


bdfdce731
7c3e4b704
bdfdce731

7c3e4b704




97c98d9d5

bdfdce731
97c98d9d5

2d622fd9b




97c98d9d5
bdfdce731

90d3aeb64
bdfdce731
90d3aeb64


bdfdce731
90d3aeb64
bdfdce731



ae75e5707
fa1e4194b
bdfdce731
2d622fd9b



26da2f9c1
97c98d9d5






2d622fd9b
bdfdce731



bdfdce731


bdfdce731
26da2f9c1
bdfdce731





b5833f942
bdfdce731


2702b572b
bdfdce731


97c98d9d5

bdfdce731

390f66a39
c4c36008b
87dbe6b33
c4c36008b

bdfdce731

3e5198089
bdfdce731
3e5198089

bdfdce731
3e5198089



bdfdce731



bdfdce731
97c98d9d5
3e5198089
bdfdce731
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
                                                                            
                                                                            














                                                                            
                                                                            



                                                                             
                    
                       
                                 
                 
                         
                   


                             
                                                               


                                                   

                     

                 

                     
                              
                              


                                                                     
 
                                                                                          
                                                                 
 
                                                                                              
                                                       



                                   
                   
                                                                  

                                                                                                 

                                   
                   
                                                  
                      



                                     
 
                                                                  

                                                                                                     

 
                                        
 
                              
                                      

                                               
                 






                                                                   

                         


                                                                           
                                            




                                                                              

                 
                     
                                                                                                 
            
         
                                                                          
                                                 


                                                                              

                                                                                              
         


        
                     
                                                                                                 
            
         
                                                                          
                                                 


                                                                              

                                                                                              
         


                 



                                                               
                                                                            

                              
                                                          
                                                               




                      
                                                  
 

                                                                                         
                      
                   



                                                          
                                   
     
                        
                           
                                                                                             
         
                            
                                          
         
              
                         

                                               



                                                      
                                   
                     
                                                  


                                                         
 
                                         

                             




                                                       

                                                                
     

                                            




                                        
                   

 
                                                                                 
 


                                                                     
                                                                  
                  



                                     
                                                                  
                                                                                                     
                           



                                   
                                                  






                                     
 



                              


                                  
                        
                                                                                                   





                                                            
                                


                        
                                   


                  

                                                                                           

 
                                                            
 
                              

 

                                    
                
     

                                                       
         



                                                                                             



                           
                                 
                                                                                         
                   
 
/***************************************************************************
 *   Copyright (C) 2007-2013 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/
#include <QPainter>
#include <QResizeEvent>
#include <QMenu>
#include <QSettings>
#include <QApplication>
#include <qmmpui/playlistmodel.h>
#include "dock.h"
#include "windowsystem.h"
#include "button.h"
#include "playlisttitlebar.h"
#include "skin.h"

// TODO {shademode, updateskin} -> do we have the shaded cursor
PlayListTitleBar::PlayListTitleBar(QWidget *parent)
        : PixmapWidget(parent)
{
    m_active = false;
    m_resize = false;
    m_shade2 = 0;
    m_model = 0;
    m_shaded = false;
    m_align = false;
    m_skin = Skin::instance();
    m_ratio = m_skin->ratio();
    connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin()));
    m_pl = qobject_cast<PlayList*>(parent);
    m_mw = qobject_cast<MainWindow*>(m_pl->parent());

    m_close = new Button(this,Skin::PL_BT_CLOSE_N, Skin::PL_BT_CLOSE_P, Skin::CUR_PCLOSE);
    connect (m_close, SIGNAL(clicked()), m_pl, SIGNAL(closed()));

    m_shade = new Button(this, Skin::PL_BT_SHADE1_N, Skin::PL_BT_SHADE1_P, Skin::CUR_PWINBUT);
    connect(m_shade, SIGNAL(clicked()), SLOT(shade()));

    resize(275*m_ratio,20*m_ratio);
    setMinimumWidth(275*m_ratio);

    readSettings();
    QSettings settings (Qmmp::configFile(), QSettings::IniFormat);
    m_pl->resize (settings.value ("Skinned/pl_size", QSize (m_ratio*275, m_ratio*116)).toSize());
    if (settings.value ("Skinned/pl_shaded", false).toBool())
        shade();
    resize(m_pl->width(),height());
    m_align = true;
    setCursor(m_skin->getCursor(Skin::CUR_PTBAR));
    updatePositions();
}


PlayListTitleBar::~PlayListTitleBar()
{
    QSettings settings (Qmmp::configFile(), QSettings::IniFormat);
    settings.setValue ("Skinned/pl_size", QSize (m_pl->width(), m_shaded ? m_height:m_pl->height()));
    settings.setValue ("Skinned/pl_shaded", m_shaded);
}

void PlayListTitleBar::updatePositions()
{
    m_ratio = m_skin->ratio();
    int sx = (width()-275*m_ratio)/25;
    m_close->move(m_ratio*264+sx*25,m_ratio*3);
    m_shade->move(m_ratio*255+sx*25,m_ratio*3);
    if (m_shade2)
        m_shade2->move(m_ratio*255+sx*25,m_ratio*3);
}

void PlayListTitleBar::updatePixmap()
{
    int sx = ((m_shaded ? m_pl->width() : width())-275*m_ratio)/25;
    QPixmap pixmap(275*m_ratio+sx*25,20*m_ratio);
    QPainter paint;
    paint.begin(&pixmap);
    if (m_shaded)
    {
        paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED2));
        for (int i = 1; i<sx+9*m_ratio; i++)
        {
            paint.drawPixmap(25*i,0,m_skin->getPlPart(Skin::PL_TFILL_SHADED));
        }
    }

    if (m_active)
    {
        if (m_shaded)
            paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_A));
        else
        {
            paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_A));
            for (int i = 1; i<sx+10*m_ratio; i++)
            {
                paint.drawPixmap(25*i,0,m_skin->getPlPart(Skin::PL_TFILL1_A));
            }
            paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_A));
            paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_A));
        }
    }
    else
    {
        if (m_shaded)
            paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_I));
        else
        {
            paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_I));
            for (int i = 1; i<sx+10*m_ratio; i++)
            {
                paint.drawPixmap(25*i,0,m_skin->getPlPart(Skin::PL_TFILL1_I));
            }
            paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_I));