By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 360
Collapse All | Expand All

(-)ori/tdebase/kcontrol/taskbar/kcmtaskbar.cpp (+28 lines)
Lines 14-19 Link Here
14
 *
14
 *
15
 *  You should have received a copy of the GNU General Public License
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
16
 *  along with this program; if not, write to the Free Software
17
18
    --------------------------------------------------------------
19
    Additional changes:
20
    - 2013/10/22 Michele Calgaro
21
      * added support for display mode (Icons and Text, Text only, Icons only)
22
        and removed "Show application icons" 
17
 */
23
 */
18
24
19
#include <tqcheckbox.h>
25
#include <tqcheckbox.h>
Lines 151-156 Link Here
151
   return i18nList;
157
   return i18nList;
152
}
158
}
153
159
160
// These are the strings that are actually stored in the config file.
161
const TQStringList& TaskbarConfig::displayIconsNText()
162
{
163
    static TQStringList list(TQStringList()
164
                << I18N_NOOP("Icons and Text")
165
                << I18N_NOOP("Text only")
166
                << I18N_NOOP("Icons only"));
167
    return list;
168
}
169
170
// Get a translated version of the above string list.
171
TQStringList TaskbarConfig::i18ndisplayIconsNText()
172
{
173
   TQStringList i18nList;
174
   for (TQStringList::ConstIterator it = displayIconsNText().begin(); it != displayIconsNText().end(); ++it)
175
   {
176
     i18nList << i18n((*it).latin1());
177
   }
178
   return i18nList;
179
}
180
154
TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList& args)
181
TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList& args)
155
  : TDECModule(TaskBarFactory::instance(), parent, name),
182
  : TDECModule(TaskBarFactory::instance(), parent, name),
156
    m_settingsObject(NULL)
183
    m_settingsObject(NULL)
Lines 211-216 Link Here
211
    m_widget->kcfg_LeftButtonAction->insertStringList(list);
238
    m_widget->kcfg_LeftButtonAction->insertStringList(list);
212
    m_widget->kcfg_MiddleButtonAction->insertStringList(list);
239
    m_widget->kcfg_MiddleButtonAction->insertStringList(list);
213
    m_widget->kcfg_RightButtonAction->insertStringList(list);
240
    m_widget->kcfg_RightButtonAction->insertStringList(list);
241
    m_widget->kcfg_DisplayIconsNText->insertStringList(i18ndisplayIconsNText());
214
    m_widget->kcfg_GroupTasks->insertStringList(i18nGroupModeList());
242
    m_widget->kcfg_GroupTasks->insertStringList(i18nGroupModeList());
215
    m_widget->kcfg_ShowTaskStates->insertStringList(i18nShowTaskStatesList());
243
    m_widget->kcfg_ShowTaskStates->insertStringList(i18nShowTaskStatesList());
216
244
(-)ori/tdebase/kcontrol/taskbar/kcmtaskbar.h (+8 lines)
Lines 14-19 Link Here
14
 *
14
 *
15
 *  You should have received a copy of the GNU General Public License
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
16
 *  along with this program; if not, write to the Free Software
17
18
    --------------------------------------------------------------
19
    Additional changes:
20
    - 2013/10/22 Michele Calgaro
21
      * added support for display mode (Icons and Text, Text only, Icons only)
22
        and removed "Show application icons" 
17
 */
23
 */
18
24
19
#ifndef __kcmtaskbar_h__
25
#ifndef __kcmtaskbar_h__
Lines 84-89 Link Here
84
    static TQStringList i18nGroupModeList();
90
    static TQStringList i18nGroupModeList();
85
    static const TQStringList& showTaskStatesList();
91
    static const TQStringList& showTaskStatesList();
86
    static TQStringList i18nShowTaskStatesList();
92
    static TQStringList i18nShowTaskStatesList();
93
    static const TQStringList& displayIconsNText();
94
    static TQStringList i18ndisplayIconsNText();
87
    TaskbarConfigUI *m_widget;
95
    TaskbarConfigUI *m_widget;
88
    TQString m_configFileName;
96
    TQString m_configFileName;
89
    TaskBarSettings* m_settingsObject;
97
    TaskBarSettings* m_settingsObject;
(-)ori/tdebase/kcontrol/taskbar/kcmtaskbarui.ui (-14 / +25 lines)
Lines 144-150 Link Here
144
                        <string>Turning this option on will allow tasks on the taskbar to be manually rearranged using drag and drop.</string>
144
                        <string>Turning this option on will allow tasks on the taskbar to be manually rearranged using drag and drop.</string>
145
                    </property>
145
                    </property>
146
                </widget>
146
                </widget>
147
                <widget class="TQCheckBox" row="8" column="0" rowspan="1" colspan="3">
147
                <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="3">
148
                    <property name="name">
148
                    <property name="name">
149
                        <cstring>kcfg_ShowWindowListBtn</cstring>
149
                        <cstring>kcfg_ShowWindowListBtn</cstring>
150
                    </property>
150
                    </property>
Lines 180-192 Link Here
180
                </widget>
180
                </widget>
181
                <widget class="TQLabel" row="9" column="0" rowspan="1" colspan="2">
181
                <widget class="TQLabel" row="9" column="0" rowspan="1" colspan="2">
182
                    <property name="name">
182
                    <property name="name">
183
			    <cstring>groupTasksLabel</cstring>
183
			                  <cstring>groupTasksLabel</cstring>
184
                    </property>
184
                    </property>
185
                    <property name="text">
185
                    <property name="text">
186
                        <string>&amp;Group similar tasks:</string>
186
                        <string>&amp;Group similar tasks:</string>
187
                    </property>
187
                    </property>
188
                    <property name="buddy" stdset="0">
188
                    <property name="buddy" stdset="0">
189
                        <cstring>kcfg_ShowTaskStates</cstring>
189
                        <cstring>kcfg_GroupTasks</cstring>
190
                    </property>
190
                    </property>
191
                </widget>
191
                </widget>
192
                <widget class="TQComboBox" row="10" column="2">
192
                <widget class="TQComboBox" row="10" column="2">
Lines 202-208 Link Here
202
                        </sizepolicy>
202
                        </sizepolicy>
203
                    </property>
203
                    </property>
204
                    <property name="whatsThis" stdset="0">
204
                    <property name="whatsThis" stdset="0">
205
			    <string>The taskbar can show and/or hide tasks based on their current process state.  Select &lt;em&gt;Any&lt;/em&gt; to show all tasks regardless of current state.</string>
205
			                  <string>The taskbar can show and/or hide tasks based on their current process state.  Select &lt;em&gt;Any&lt;/em&gt; to show all tasks regardless of current state.</string>
206
                    </property>
206
                    </property>
207
                </widget>
207
                </widget>
208
                <widget class="TQLabel" row="10" column="0" rowspan="1" colspan="2">
208
                <widget class="TQLabel" row="10" column="0" rowspan="1" colspan="2">
Lines 210-216 Link Here
210
                        <cstring>showTaskStatesLabel</cstring>
210
                        <cstring>showTaskStatesLabel</cstring>
211
                    </property>
211
                    </property>
212
                    <property name="text">
212
                    <property name="text">
213
			    <string>&amp;Show tasks with state:</string>
213
			                  <string>&amp;Show tasks with state:</string>
214
                    </property>
214
                    </property>
215
                    <property name="buddy" stdset="0">
215
                    <property name="buddy" stdset="0">
216
                        <cstring>kcfg_ShowTaskStates</cstring>
216
                        <cstring>kcfg_ShowTaskStates</cstring>
Lines 229-248 Link Here
229
By default, this option is not selected and the taskbar will show all windows.</string>
229
By default, this option is not selected and the taskbar will show all windows.</string>
230
                    </property>
230
                    </property>
231
                </widget>
231
                </widget>
232
                <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="3">
232
                <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="2">
233
                    <property name="name">
233
                    <property name="name">
234
                        <cstring>kcfg_ShowIcon</cstring>
234
                        <cstring>displayIconsNText</cstring>
235
                    </property>
235
                    </property>
236
                    <property name="text">
236
                    <property name="text">
237
                        <string>Sho&amp;w application icons</string>
237
                        <string>Dis&amp;play:</string>
238
                    </property>
238
                    </property>
239
                    <property name="checked">
239
                    <property name="buddy" stdset="0">
240
                        <bool>true</bool>
240
                        <cstring>kcfg_DisplayIconsNText</cstring>
241
                    </property>
242
                </widget>
243
                <widget class="TQComboBox" row="8" column="2">
244
                    <property name="name">
245
                        <cstring>kcfg_DisplayIconsNText</cstring>
246
                    </property>
247
                    <property name="sizePolicy">
248
                        <sizepolicy>
249
                            <hsizetype>7</hsizetype>
250
                            <vsizetype>0</vsizetype>
251
                            <horstretch>0</horstretch>
252
                            <verstretch>0</verstretch>
253
                        </sizepolicy>
241
                    </property>
254
                    </property>
242
                    <property name="whatsThis" stdset="0">
255
                    <property name="whatsThis" stdset="0">
243
                        <string>Select this option if you want window icons to appear along with their titles in the taskbar.
256
                        <string>Choose taskbar display mode among &lt;strong&gt;Icons and text&lt;/strong&gt;, &lt;strong&gt;Text only&lt;/strong&gt; and &lt;strong&gt;Icons only&lt;/strong&gt;.</string>
244
245
By default this option is selected.</string>
246
                    </property>
257
                    </property>
247
                </widget>
258
                </widget>
248
                <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="3">
259
                <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="3">
Lines 568-575 Link Here
568
    <tabstop>showAllScreens</tabstop>
579
    <tabstop>showAllScreens</tabstop>
569
    <tabstop>kcfg_SortByApp</tabstop>
580
    <tabstop>kcfg_SortByApp</tabstop>
570
    <tabstop>kcfg_ShowOnlyIconified</tabstop>
581
    <tabstop>kcfg_ShowOnlyIconified</tabstop>
571
    <tabstop>kcfg_ShowIcon</tabstop>
572
    <tabstop>kcfg_ShowWindowListBtn</tabstop>
582
    <tabstop>kcfg_ShowWindowListBtn</tabstop>
583
    <tabstop>kcfg_DisplayIconsNText</tabstop>
573
    <tabstop>kcfg_GroupTasks</tabstop>
584
    <tabstop>kcfg_GroupTasks</tabstop>
574
    <tabstop>kcfg_ShowTaskStates</tabstop>
585
    <tabstop>kcfg_ShowTaskStates</tabstop>
575
    <tabstop>appearance</tabstop>
586
    <tabstop>appearance</tabstop>
(-)ori/tdebase/kicker/taskbar/taskbar.cpp (-70 / +52 lines)
Lines 20-27 Link Here
20
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
*****************************************************************
23
24
24
******************************************************************/
25
    Additional changes:
26
    - 2013/10/22 Michele Calgaro
27
      * added support for display mode (Icons and Text, Text only, Icons only)
28
        and removed "Show application icons" 
29
*/
25
30
26
#include <math.h>
31
#include <math.h>
27
32
Lines 58-64 Link Here
58
      m_currentScreen(-1),
63
      m_currentScreen(-1),
59
      m_showOnlyCurrentScreen(false),
64
      m_showOnlyCurrentScreen(false),
60
      m_sortByDesktop(false),
65
      m_sortByDesktop(false),
61
      m_showIcon(false),
66
      m_displayIconsNText(settingsObject->DisplayIconsAndText),
62
      m_showOnlyIconified(false),
67
      m_showOnlyIconified(false),
63
      m_showTaskStates(0),
68
      m_showTaskStates(0),
64
      m_textShadowEngine(0),
69
      m_textShadowEngine(0),
Lines 196-261 Link Here
196
201
197
    if ( p == KPanelExtension::Left || p == KPanelExtension::Right )
202
    if ( p == KPanelExtension::Left || p == KPanelExtension::Right )
198
    {
203
    {
199
        int actualMax = minButtonHeight * containerCount();
204
        // Vertical layout
200
205
        // Minimum space allows for one icon, the window list button and the up/down scrollers
201
        if (containerCount() == 0)
206
        int minHeight = minButtonHeight*3;
202
        {
207
        if (minHeight > maxSize.height())
203
            actualMax = minButtonHeight;
204
        }
205
206
        if (actualMax > maxSize.height())
207
        {
208
            return maxSize;
208
            return maxSize;
209
        }
209
        return TQSize(maxSize.width(), minHeight);
210
        return TQSize( maxSize.width(), actualMax );
211
    }
210
    }
212
    else
211
    else
213
    {
212
    {
214
        int rows = KickerSettings::conserveSpace() ?
213
        // Horizontal layout
215
                   contentsRect().height() / minButtonHeight :
214
        // Minimum space allows for one column of icons, the window list button and the left/right scrollers
216
                   1;
215
        int min_width=BUTTON_MIN_WIDTH*3;
217
        if ( rows < 1 )
216
        if (min_width > maxSize.width())
218
        {
217
            return maxSize;
219
            rows = 1;
218
        return TQSize(min_width, maxSize.height());
220
        }
221
222
        int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
223
        if (maxWidth == 0)
224
        {
225
            maxWidth = BUTTON_MAX_WIDTH;
226
        }
227
228
        int actualMax = maxWidth * (containerCount() / rows);
229
230
        if (containerCount() % rows > 0)
231
        {
232
            actualMax += maxWidth;
233
        }
234
        if (containerCount() == 0)
235
        {
236
            actualMax = maxWidth;
237
        }
238
239
        if (actualMax > maxSize.width())
240
        {
241
           return maxSize;
242
        }
243
        return TQSize( actualMax, maxSize.height() );
244
    }
219
    }
245
}
220
}
246
221
222
bool TaskBar::showIcons() const
223
{
224
  return (m_displayIconsNText==m_settingsObject->DisplayIconsAndText ||
225
          m_displayIconsNText==m_settingsObject->DisplayIconsOnly);
226
}
227
bool TaskBar::showText() const
228
{
229
  return (m_displayIconsNText==m_settingsObject->DisplayIconsAndText ||
230
          m_displayIconsNText==m_settingsObject->DisplayTextOnly);
231
}
232
247
void TaskBar::configure()
233
void TaskBar::configure()
248
{
234
{
249
    bool wasShowWindows = m_showAllWindows;
235
    bool wasShowWindows = m_showAllWindows;
250
    bool wasSortByDesktop = m_sortByDesktop;
236
    bool wasSortByDesktop = m_sortByDesktop;
251
    bool wasCycleWheel = m_cycleWheel;
237
    bool wasCycleWheel = m_cycleWheel;
252
    bool wasShowIcon = m_showIcon;
238
    bool wasDisplayIconsNText = m_displayIconsNText;
253
    bool wasShowOnlyIconified = m_showOnlyIconified;
239
    bool wasShowOnlyIconified = m_showOnlyIconified;
254
    int  wasShowTaskStates = m_showTaskStates;
240
    int  wasShowTaskStates = m_showTaskStates;
255
241
256
    m_showAllWindows = READ_MERGED_TASBKAR_SETTING(showAllWindows);
242
    m_showAllWindows = READ_MERGED_TASBKAR_SETTING(showAllWindows);
257
    m_sortByDesktop = m_showAllWindows && READ_MERGED_TASBKAR_SETTING(sortByDesktop);
243
    m_sortByDesktop = m_showAllWindows && READ_MERGED_TASBKAR_SETTING(sortByDesktop);
258
    m_showIcon = READ_MERGED_TASBKAR_SETTING(showIcon);
244
    m_displayIconsNText = READ_MERGED_TASBKAR_SETTING(displayIconsNText);
259
    m_showOnlyIconified = READ_MERGED_TASBKAR_SETTING(showOnlyIconified);
245
    m_showOnlyIconified = READ_MERGED_TASBKAR_SETTING(showOnlyIconified);
260
    m_cycleWheel = READ_MERGED_TASBKAR_SETTING(cycleWheel);
246
    m_cycleWheel = READ_MERGED_TASBKAR_SETTING(cycleWheel);
261
    m_showTaskStates = READ_MERGED_TASBKAR_SETTING(showTaskStates);
247
    m_showTaskStates = READ_MERGED_TASBKAR_SETTING(showTaskStates);
Lines 280-286 Link Here
280
266
281
    if (wasShowWindows != m_showAllWindows ||
267
    if (wasShowWindows != m_showAllWindows ||
282
        wasSortByDesktop != m_sortByDesktop ||
268
        wasSortByDesktop != m_sortByDesktop ||
283
        wasShowIcon != m_showIcon ||
269
        wasDisplayIconsNText != m_displayIconsNText ||
284
        wasCycleWheel != m_cycleWheel ||
270
        wasCycleWheel != m_cycleWheel ||
285
        wasShowOnlyIconified != m_showOnlyIconified ||
271
        wasShowOnlyIconified != m_showOnlyIconified ||
286
        wasShowTaskStates != m_showTaskStates)
272
        wasShowTaskStates != m_showTaskStates)
Lines 757-781 Link Here
757
    // horizontal layout
743
    // horizontal layout
758
    if (orientation() == Qt::Horizontal)
744
    if (orientation() == Qt::Horizontal)
759
    {
745
    {
760
        int bwidth = BUTTON_MIN_WIDTH;
746
        int bwidth=BUTTON_MIN_WIDTH;
761
        int rows = contentsRect().height() / minButtonHeight;
747
        int rows = contentsRect().height() / minButtonHeight;
762
748
        if (rows<1)
763
        if ( rows < 1 )
749
          rows=1;
764
        {
765
            rows = 1;
766
        }
767
750
768
        // actual button height
751
        // actual button height
769
        int bheight = contentsRect().height() / rows;
752
        int bheight = contentsRect().height() / rows;
770
753
        if (bheight<1)  // avoid zero devision later
771
        // avoid zero devision later
754
          bheight=1;
772
        if (bheight < 1)
773
        {
774
            bheight = 1;
775
        }
776
755
777
        // buttons per row
756
        // buttons per row
778
        int bpr = (int)ceil( (double)list.count() / rows);
757
        int bpr = static_cast<int>(ceil(static_cast<double>(list.count()) / rows));
779
758
780
        // adjust content size
759
        // adjust content size
781
        if ( contentsRect().width() < bpr * BUTTON_MIN_WIDTH )
760
        if ( contentsRect().width() < bpr * BUTTON_MIN_WIDTH )
Lines 786-802 Link Here
786
        // maximum number of buttons per row
765
        // maximum number of buttons per row
787
        int mbpr = contentsRect().width() / BUTTON_MIN_WIDTH;
766
        int mbpr = contentsRect().width() / BUTTON_MIN_WIDTH;
788
767
789
        // expand button width if space permits
768
        // expand button width if space permits and the taskbar is not in 'icons only' mode
790
        if (mbpr > bpr)
769
        if (mbpr > bpr)
791
        {
770
        {
792
            bwidth = contentsRect().width() / bpr;
771
            if (!showIcons() || showText())
772
              bwidth = contentsRect().width() / bpr;
793
            int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
773
            int maxWidth = READ_MERGED_TASBKAR_SETTING(maximumButtonWidth);
794
            if (maxWidth > 0 && bwidth > maxWidth)
774
            if (maxWidth > 0 && bwidth > maxWidth)
795
            {
775
            {
796
                bwidth = maxWidth;
776
                bwidth = maxWidth;
797
            }
777
            }
798
        }
778
        }
799
779
  
800
        // layout containers
780
        // layout containers
801
781
802
        // for taskbars at the bottom, we need to ensure that the bottom
782
        // for taskbars at the bottom, we need to ensure that the bottom
Lines 840-849 Link Here
840
    }
820
    }
841
    else // vertical layout
821
    else // vertical layout
842
    {
822
    {
823
        // Adjust min button height to keep gaps into account
824
        int minButtonHeightAdjusted=minButtonHeight+4;
843
        // adjust content size
825
        // adjust content size
844
        if (contentsRect().height() < (int)list.count() * minButtonHeight)
826
        if (contentsRect().height() < (int)list.count() * minButtonHeightAdjusted)
845
        {
827
        {
846
            resizeContents(contentsRect().width(), list.count() * minButtonHeight);
828
            resizeContents(contentsRect().width(), list.count() * minButtonHeightAdjusted);
847
        }
829
        }
848
830
849
        // layout containers
831
        // layout containers
Lines 856-866 Link Here
856
838
857
            c->setArrowType(arrowType);
839
            c->setArrowType(arrowType);
858
            
840
            
859
            if (c->width() != contentsRect().width() || c->height() != minButtonHeight)
841
            if (c->width() != contentsRect().width() || c->height() != minButtonHeightAdjusted)
860
                c->resize(contentsRect().width(), minButtonHeight);
842
                c->resize(contentsRect().width(), minButtonHeightAdjusted);
861
843
862
            if (childX(c) != 0 || childY(c) != (i * minButtonHeight))
844
            if (childX(c) != 0 || childY(c) != (i * minButtonHeightAdjusted))
863
                moveChild(c, 0, i * minButtonHeight);
845
                moveChild(c, 0, i * minButtonHeightAdjusted);
864
            
846
            
865
            c->setBackground();
847
            c->setBackground();
866
            i++;
848
            i++;
Lines 1041-1048 Link Here
1041
bool TaskBar::shouldGroup() const
1023
bool TaskBar::shouldGroup() const
1042
{
1024
{
1043
    return READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupAlways ||
1025
    return READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupAlways ||
1044
           (READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupWhenFull &&
1026
           ((READ_MERGED_TASBKAR_SETTING(groupTasks) == m_settingsObject->GroupWhenFull &&
1045
            taskCount() > maximumButtonsWithoutShrinking());
1027
             taskCount() > maximumButtonsWithoutShrinking()));
1046
}
1028
}
1047
1029
1048
void TaskBar::reGroup()
1030
void TaskBar::reGroup()
(-)ori/tdebase/kicker/taskbar/taskbar.h (-30 / +36 lines)
Lines 19-25 Link Here
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
22
******************************************************************/
22
*****************************************************************
23
    
24
    Additional changes:
25
    - 2013/10/22 Michele Calgaro
26
      * added support for display mode (Icons and Text, Text only, Icons only)
27
        and removed "Show application icons" 
28
*/
23
29
24
#ifndef __taskbar_h__
30
#ifndef __taskbar_h__
25
#define __taskbar_h__
31
#define __taskbar_h__
Lines 31-39 Link Here
31
#include "panner.h"
37
#include "panner.h"
32
#include "kshadowengine.h"
38
#include "kshadowengine.h"
33
39
34
#define WINDOWLISTBUTTON_SIZE 15
40
const int WINDOWLISTBUTTON_SIZE = 15;
35
#define BUTTON_MAX_WIDTH 200
41
const int BUTTON_MAX_WIDTH      = 200;
36
#define BUTTON_MIN_WIDTH 20
42
const int BUTTON_MIN_WIDTH      = 24;    // 24 = 4+2+16+2 -> Space for borders, application icon and gaps
37
43
38
class Startup;
44
class Startup;
39
class Task;
45
class Task;
Lines 85-91 Link Here
85
    int taskCount() const;
91
    int taskCount() const;
86
    int showScreen() const;
92
    int showScreen() const;
87
93
88
    bool showIcon() const { return m_showIcon; }
94
    bool showIcons() const;
95
    bool showText() const;  
89
    bool sortByDesktop() const { return m_sortByDesktop; }
96
    bool sortByDesktop() const { return m_sortByDesktop; }
90
    bool showAllWindows() const { return m_showAllWindows; }
97
    bool showAllWindows() const { return m_showAllWindows; }
91
98
Lines 140-170 Link Here
140
    void sortContainersByDesktop(TaskContainer::List& list);
147
    void sortContainersByDesktop(TaskContainer::List& list);
141
    void setViewportBackground();
148
    void setViewportBackground();
142
149
143
    bool			blocklayout;
150
    bool			          blocklayout;
144
    bool			m_showAllWindows;
151
    bool			          m_showAllWindows;
145
    bool			m_cycleWheel;
152
    bool			          m_cycleWheel;
146
    // The screen to show, -1 for all screens
153
    int 			          m_currentScreen;    // The screen to show, -1 for all screens
147
    int 			m_currentScreen;
154
    bool			          m_showOnlyCurrentScreen;
148
    bool			m_showOnlyCurrentScreen;
155
    bool			          m_sortByDesktop;
149
    bool			m_sortByDesktop;
156
    int                 m_displayIconsNText;
150
    bool			m_showIcon;
157
    bool			          m_showOnlyIconified;
151
    bool			m_showOnlyIconified;
158
    int				          m_showTaskStates;
152
    int				m_showTaskStates;
159
    ArrowType 			    arrowType;
153
    ArrowType 			arrowType;
160
    TaskContainer::List	containers;
154
    TaskContainer::List		containers;
161
    TaskContainer::List	m_hiddenContainers;
155
    TaskContainer::List		m_hiddenContainers;
162
    TaskContainer::List	m_deletableContainers;
156
    TaskContainer::List		m_deletableContainers;
163
    PixmapList			    frames;
157
    PixmapList			frames;
164
    int                 maximumButtonsWithoutShrinking() const;
158
    int                         maximumButtonsWithoutShrinking() const;
165
    bool                shouldGroup() const;
159
    bool                        shouldGroup() const;
166
    bool                isGrouping;
160
    bool                        isGrouping;
167
    void                reGroup();
161
    void                        reGroup();
168
    TDEGlobalAccel*     keys;
162
    TDEGlobalAccel*               keys;
169
    KTextShadowEngine*	m_textShadowEngine;
163
    KTextShadowEngine*		m_textShadowEngine;
170
    bool			          m_ignoreUpdates;
164
    bool			m_ignoreUpdates;
171
    bool			          m_sortByAppPrev;
165
    bool			m_sortByAppPrev;
172
    TQTimer			        m_relayoutTimer;
166
    TQTimer			m_relayoutTimer;
173
    TQImage			        m_blendGradient;
167
    TQImage			m_blendGradient;
168
    TaskBarSettings*		m_settingsObject;
174
    TaskBarSettings*		m_settingsObject;
169
    TaskBarSettings*		m_globalSettingsObject;
175
    TaskBarSettings*		m_globalSettingsObject;
170
};
176
};
(-)ori/tdebase/kicker/taskbar/taskbar.kcfg (-5 / +16 lines)
Lines 31-36 Link Here
31
            <label>Show only minimized windows</label>
31
            <label>Show only minimized windows</label>
32
            <whatsthis>Select this option if you want the taskbar to display <b>only</b> minimized windows. By default, this option is not selected and the taskbar will show all windows.</whatsthis>
32
            <whatsthis>Select this option if you want the taskbar to display <b>only</b> minimized windows. By default, this option is not selected and the taskbar will show all windows.</whatsthis>
33
        </entry>
33
        </entry>
34
        <entry key="DisplayIconsNText" type="Enum" >
35
            <choices>
36
                <choice name="DisplayIconsAndText">
37
                    <label>Never</label>
38
                </choice>
39
                <choice name="DisplayTextOnly">
40
                    <label>When Taskbar Full</label>
41
                </choice>
42
                <choice name="DisplayIconsOnly">
43
                    <label>Always</label>
44
                </choice>
45
            </choices>
46
            <default>DisplayIconsAndText</default>
47
            <label>Display:</label>
48
            <whatsthis>Choose taskbar display mode among <strong>Icons and text</strong>, <strong>Text only</strong> and <strong>Icons only</strong></whatsthis>
49
        </entry>
34
        <entry key="GroupTasks" type="Enum" >
50
        <entry key="GroupTasks" type="Enum" >
35
            <choices>
51
            <choices>
36
                <choice name="GroupNever">
52
                <choice name="GroupNever">
Lines 73-83 Link Here
73
            <label>Sort windows by application</label>
89
            <label>Sort windows by application</label>
74
            <whatsthis>Selecting this option causes the taskbar to show windows ordered by application. By default this option is selected.</whatsthis>
90
            <whatsthis>Selecting this option causes the taskbar to show windows ordered by application. By default this option is selected.</whatsthis>
75
        </entry>
91
        </entry>
76
        <entry key="ShowIcon" type="Bool" >
77
            <default>true</default>
78
            <label>Show application icons</label>
79
            <whatsthis>Select this option if you want window icons to appear along with their titles in the taskbar. By default this option is selected.</whatsthis>
80
        </entry>
81
        <entry key="MaximumButtonWidth" type="Int" >
92
        <entry key="MaximumButtonWidth" type="Int" >
82
            <default>200</default>
93
            <default>200</default>
83
            <min>0</min>
94
            <min>0</min>
(-)ori/tdebase/kicker/taskbar/taskcontainer.cpp (-154 / +158 lines)
Lines 21-27 Link Here
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
24
******************************************************************/
24
*****************************************************************
25
26
    Additional changes:
27
    - 2013/10/22 Michele Calgaro
28
      * added support for display mode (Icons and Text, Text only, Icons only)
29
        and removed "Show application icons" 
30
*/
25
31
26
#include <assert.h>
32
#include <assert.h>
27
33
Lines 216-222 Link Here
216
222
217
void TaskContainer::showMe()
223
void TaskContainer::showMe()
218
{
224
{
219
    if(!frames.isEmpty() && taskBar->showIcon())
225
    if(!frames.isEmpty() && taskBar->showIcons())
220
        animationTimer.start(100);
226
        animationTimer.start(100);
221
227
222
    emit showMe(this);
228
    emit showMe(this);
Lines 307-334 Link Here
307
313
308
void TaskContainer::animationTimerFired()
314
void TaskContainer::animationTimerFired()
309
{
315
{
310
    if (!frames.isEmpty() && taskBar->showIcon() && frames.at(currentFrame) != frames.end())
316
    if (!frames.isEmpty() && taskBar->showIcons() && frames.at(currentFrame) != frames.end())
311
    {
317
    {
312
        TQPixmap *pm = *frames.at(currentFrame);
318
      TQPixmap *pm = *frames.at(currentFrame);
313
319
314
        // draw pixmap
320
      // draw pixmap
315
        if ( pm && !pm->isNull() ) {
321
      if ( pm && !pm->isNull() )
322
      {
316
	    // we only have to redraw the background for frames 0, 8 and 9
323
	    // we only have to redraw the background for frames 0, 8 and 9
317
	    if ( currentFrame == 0 || currentFrame > 7 ) {
324
	      if ( currentFrame == 0 || currentFrame > 7 )
318
		// double buffered painting
325
        {
319
		TQPixmap composite( animBg );
326
          // double buffered painting
320
		bitBlt( &composite, 0, 0, pm );
327
          TQPixmap composite( animBg );
321
		bitBlt( this, iconRect.x(), iconRect.y(), &composite );
328
          bitBlt( &composite, 0, 0, pm );
322
    	    }
329
          bitBlt( this, iconRect.x(), iconRect.y(), &composite );
323
	    else
330
    	  }
324
		bitBlt( this, iconRect.x(), iconRect.y(), pm );
331
	      else
325
	}
332
		      bitBlt( this, iconRect.x(), iconRect.y(), pm );
326
333
	    }
327
        // increment frame counter
334
328
        if ( currentFrame >= 9)
335
      // increment frame counter
329
	    currentFrame = 0;
336
      if ( currentFrame >= 9)
330
        else
337
	      currentFrame = 0;
331
	    currentFrame++;
338
      else
339
	      currentFrame++;
332
    }
340
    }
333
}
341
}
334
342
Lines 685-836 Link Here
685
    {
693
    {
686
        p->translate(shift.x(), shift.y());
694
        p->translate(shift.x(), shift.y());
687
    }
695
    }
696
    
697
    TQString text = name();  // find text
698
    int textPos = ( taskBar->showIcons() && (!pixmap.isNull() || m_startup)) ? 2 + 16 + 2 : 0;
688
699
689
    if (taskBar->showIcon())
700
    // show icons
690
    {
701
    if (taskBar->showIcons())
691
        if (pixmap.isNull() && m_startup)
692
        {
693
            pixmap = SmallIcon(m_startup->icon());
694
        }
695
696
        if ( !pixmap.isNull() )
697
        {
698
            // make sure it is no larger than 16x16
699
            if ( pixmap.width() > 16 || pixmap.height() > 16 )
700
            {
701
                TQImage tmp = pixmap.convertToImage();
702
                pixmap.convertFromImage( tmp.smoothScale( 16, 16 ) );
703
            }
704
705
            // fade out the icon when minimized
706
            if (iconified)
707
            {
708
                TDEIconEffect::semiTransparent( pixmap );
709
            }
710
711
            // draw icon
712
            TQRect pmr(0, 0, pixmap.width(), pixmap.height());
713
            pmr.moveCenter(iconRect.center());
714
            p->drawPixmap(pmr, pixmap);
715
        }
716
    }
717
718
    // find text
719
    TQString text = name();
720
721
    // modified overlay
722
    static TQString modStr = "[" + i18n( "modified" ) + "]";
723
    int modStrPos = text.find( modStr );
724
    int textPos = ( taskBar->showIcon() && (!pixmap.isNull() || m_startup)) ? 2 + 16 + 2 : 0;
725
726
    if (modStrPos >= 0)
727
    {
702
    {
728
        // +1 because we include a space after the closing brace.
703
      if (pixmap.isNull() && m_startup)
729
        text.remove(modStrPos, modStr.length() + 1);
704
          pixmap = SmallIcon(m_startup->icon());
730
        TQPixmap modPixmap = SmallIcon("modified");
731
732
        // draw modified overlay
733
        if (!modPixmap.isNull())
734
        {
735
            TQRect r = TQStyle::visualRect(TQRect(br.x() + textPos,
736
                                               (height() - 16) / 2, 16, 16),
737
                                         this);
738
705
706
      if ( !pixmap.isNull() )
707
      {
708
          // make sure it is no larger than 16x16
709
          if ( pixmap.width() > 16 || pixmap.height() > 16 )
710
          {
711
              TQImage tmp = pixmap.convertToImage();
712
              pixmap.convertFromImage( tmp.smoothScale( 16, 16 ) );
713
          }
714
715
          // fade out the icon when minimized
716
          if (iconified)
717
              TDEIconEffect::semiTransparent( pixmap );
718
719
          // draw icon
720
          TQRect pmr(0, 0, pixmap.width(), pixmap.height());
721
          pmr.moveCenter(iconRect.center());
722
          p->drawPixmap(pmr, pixmap);
723
      }
724
725
      // modified overlay icon
726
      if (taskBar->showText())
727
      {
728
        static TQString modStr = "[" + i18n( "modified" ) + "]";
729
        int modStrPos = text.find( modStr );
730
        if (modStrPos >= 0)
731
        {
732
          // +1 because we include a space after the closing brace.
733
          text.remove(modStrPos, modStr.length() + 1);
734
          TQPixmap modPixmap = SmallIcon("modified");
735
736
          // draw modified overlay
737
          if (!modPixmap.isNull())
738
          {
739
            TQRect r = TQStyle::visualRect(TQRect(br.x() + textPos,(height() - 16) / 2, 16, 16), this);
739
            if (iconified)
740
            if (iconified)
740
            {
741
            {
741
                TDEIconEffect::semiTransparent(modPixmap);
742
              TDEIconEffect::semiTransparent(modPixmap);
742
            }
743
            }
743
744
            p->drawPixmap(r, modPixmap);
744
            p->drawPixmap(r, modPixmap);
745
            textPos += 16 + 2;
745
            textPos += 16 + 2;
746
          }
746
        }
747
        }
748
      }      
747
    }
749
    }
748
750
749
    // draw text
751
    // draw text
750
    if (!text.isEmpty())
752
    if (taskBar->showText())
751
    {
753
    {
752
        TQRect tr = TQStyle::visualRect(TQRect(br.x() + textPos + 1, 0,
754
      if (!text.isEmpty())
753
                                            width() - textPos, height()),
755
      {
754
                                      this);
756
          TQRect tr = TQStyle::visualRect(TQRect(br.x() + textPos + 1, 0,
755
        int textFlags = AlignVCenter | SingleLine;
757
                                          width() - textPos, height()), this);
756
        textFlags |= reverse ? AlignRight : AlignLeft;
758
          int textFlags = AlignVCenter | SingleLine;
757
        TQPen textPen;
759
          textFlags |= reverse ? AlignRight : AlignLeft;
758
760
          TQPen textPen;
759
        // get the color for the text label
761
760
        if (iconified)
762
          // get the color for the text label
761
        {
763
          if (iconified)
762
            textPen = TQPen(KickerLib::blendColors(colors.button(), colors.buttonText()));
764
          {
763
        }
765
              textPen = TQPen(KickerLib::blendColors(colors.button(), colors.buttonText()));
764
        else if (!active)
766
          }
765
        {
767
          else if (!active)
766
            textPen = TQPen(colors.buttonText());
768
          {
767
        }
769
              textPen = TQPen(colors.buttonText());
768
        else // hack for the dotNET style and others
770
          }
769
        {
771
          else // hack for the dotNET style and others
770
            if (READ_MERGED_TASBKAR_SETTING(useCustomColors))
772
          {
771
            {
773
              if (READ_MERGED_TASBKAR_SETTING(useCustomColors))
772
                textPen = TQPen(READ_MERGED_TASBKAR_SETTING(activeTaskTextColor));
774
              {
773
            }
775
                  textPen = TQPen(READ_MERGED_TASBKAR_SETTING(activeTaskTextColor));
774
            else
776
              }
775
            {
777
              else
776
                textPen = TQPen(colors.buttonText()); // textPen = p->pen();
778
              {
777
            }
779
                  textPen = TQPen(colors.buttonText()); // textPen = p->pen();
778
        }
780
              }
779
781
          }
780
        int availableWidth = width() - (br.x() * 2) - textPos - 2 - (READ_MERGED_TASBKAR_SETTING(drawButtons) && KickerSettings::showDeepButtons())?2:0;
782
781
        if (m_filteredTasks.count() > 1)
783
          int availableWidth = width() - (br.x() * 2) - textPos - 2 - (READ_MERGED_TASBKAR_SETTING(drawButtons) && KickerSettings::showDeepButtons())?2:0;
782
        {
784
          if (m_filteredTasks.count() > 1)
783
            availableWidth -= 8;
785
          {
784
        }
786
              availableWidth -= 8;
785
787
          }
786
        if (TQFontMetrics(font).width(text) > availableWidth)
788
787
        {
789
          if (TQFontMetrics(font).width(text) > availableWidth)
788
            // draw text into overlay pixmap
790
          {
789
            TQPixmap tpm(*pm);
791
              // draw text into overlay pixmap
790
            TQPainter tp(&tpm);
792
              TQPixmap tpm(*pm);
791
793
              TQPainter tp(&tpm);
792
            if (sunken)
794
793
            {
795
              if (sunken)
794
                tp.translate(shift.x(), shift.y());
796
              {
795
            }
797
                  tp.translate(shift.x(), shift.y());
796
798
              }
797
            tp.setFont(font);
799
798
            tp.setPen(textPen);
800
              tp.setFont(font);
799
801
              tp.setPen(textPen);
800
            if (halo)
802
801
            {
803
              if (halo)
802
                taskBar->textShadowEngine()->drawText(tp, tr, textFlags, text, size());
804
              {
803
            }
805
                  taskBar->textShadowEngine()->drawText(tp, tr, textFlags, text, size());
804
            else
806
              }
805
            {
807
              else
806
                tp.drawText(tr, textFlags, text);
808
              {
807
            }
809
                  tp.drawText(tr, textFlags, text);
808
810
              }
809
            // blend text into background image
811
810
            TQImage img = pm->convertToImage();
812
              // blend text into background image
811
            TQImage timg = tpm.convertToImage();
813
              TQImage img = pm->convertToImage();
812
            KImageEffect::blend(img, timg, *taskBar->blendGradient(size()), KImageEffect::Red);
814
              TQImage timg = tpm.convertToImage();
813
815
              KImageEffect::blend(img, timg, *taskBar->blendGradient(size()), KImageEffect::Red);
814
            // End painting before assigning the pixmap
816
815
            TQPaintDevice* opd = p->device();
817
              // End painting before assigning the pixmap
816
            p->end();
818
              TQPaintDevice* opd = p->device();
817
            pm->convertFromImage(img);
819
              p->end();
818
            p->begin(opd ,this);
820
              pm->convertFromImage(img);
819
        }
821
              p->begin(opd ,this);
820
        else
822
          }
821
        {
823
          else
822
            p->setFont(font);
824
          {
823
            p->setPen(textPen);
825
              p->setFont(font);
824
826
              p->setPen(textPen);
825
            if (halo)
827
826
            {
828
              if (halo)
827
                taskBar->textShadowEngine()->drawText(*p, tr, textFlags, text, size());
829
              {
828
            }
830
                  taskBar->textShadowEngine()->drawText(*p, tr, textFlags, text, size());
829
            else
831
              }
830
            {
832
              else
831
                p->drawText(tr, textFlags, text);
833
              {
832
            }
834
                  p->drawText(tr, textFlags, text);
833
        }
835
              }
836
          }
837
      }
834
    }
838
    }
835
839
836
    if (!frames.isEmpty() && m_startup && frames.at(currentFrame) != frames.end())
840
    if (!frames.isEmpty() && m_startup && frames.at(currentFrame) != frames.end())

Return to bug 360