1088{
1089 RECT TaskbarButtonsRect;
1091
1092 int taskbarScrollIndicatorSize;
1096
1097
1098
1099
1100
1103 if (lastButton < 0) lastButton = (int)
taskList.size()-1;
1104
1105
1107 {
1109 else TaskbarButtonsRect.left += taskbarScrollIndicatorSize;
1110 }
1111
1112
1113 for (
int i = (lastButton+1); i < (int)
taskList.size(); i++)
1114 {
1116 else
1117 {
1119 else TaskbarButtonsRect.right -= taskbarScrollIndicatorSize;
1120 break;
1121 }
1122 }
1123
1124
1127
1128
1129
1130
1131
1135 {
1137
1138
1139
1141
1143 }
1144 else
1145 {
1147 }
1148
1150
1151
1152
1153
1154
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1186 {
1188 }
1189 else
1190 {
1193
1194 }
1195
1197
1198
1199
1200
1202 {
1203
1204
1205
1206
1207
1208
1210
1213 DeleteObject(oldBitmapActive);
1214 MakeGradientSuper(
cachedTaskButtonActive, r,
pSettings->
ActiveTask->
type,
pSettings->
ActiveTask->Color1,
pSettings->
ActiveTask->Color2,
pSettings->
ActiveTask->
Color3,
pSettings->
ActiveTask->
Color4,
pSettings->
ActiveTask->
Color5,
pSettings->
ActiveTask->
Color6,
pSettings->
ActiveTask->
Color7,
pSettings->
ActiveTask->
Color8,
pSettings->
ActiveTask->
interlaced,
pSettings->
ActiveTask->
bevelstyle,
pSettings->
ActiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
ActiveTask->
borderColor,
pSettings->
ActiveTask->
borderWidth);
1215 DeleteObject(tempBitmapActive);
1216
1219 DeleteObject(oldBitmapInactive);
1220 MakeGradientSuper(
cachedTaskButtonInactive, r,
pSettings->
InactiveTask->
type,
pSettings->
InactiveTask->Color1,
pSettings->
InactiveTask->Color2,
pSettings->
InactiveTask->
Color3,
pSettings->
InactiveTask->
Color4,
pSettings->
InactiveTask->
Color5,
pSettings->
InactiveTask->
Color6,
pSettings->
InactiveTask->
Color7,
pSettings->
InactiveTask->
Color8,
pSettings->
InactiveTask->
interlaced,
pSettings->
InactiveTask->
bevelstyle,
pSettings->
InactiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
InactiveTask->
borderColor,
pSettings->
InactiveTask->
borderWidth);
1221 DeleteObject(tempBitmapInactive);
1222
1223
1225 }
1226
1227
1228
1229
1231
1232
1234 {
1237 }
1238
1239
1240
1241
1242 int drawnTasks = 0;
1243
1244 for (int i = firstButton; i <= lastButton; i++)
1245 {
1247
1248
1250
1252
1253
1254
1255
1256
1258
1260 {
1263
1264
1266
1268 }
1269 else
1270 {
1273
1275 {
1276
1278 }
1279
1281 }
1282
1284
1285
1286
1287
1289 {
1291
1292 RECT r;
1294
1295 COLORREF priorityIndicatorColor = 0x0000ff;
1296 COLORREF stickyIndicatorColor = 0x008888;
1297
1298
1299 if (
CheckSticky(
taskList[i]->hwnd))
MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.top), stickyIndicatorColor, stickyIndicatorColor, GetPixel(hdc, r.right - 1, r.top), 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1300 else MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.top), priorityIndicatorColor, priorityIndicatorColor, GetPixel(hdc, r.right-1, r.top), 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1301
1303 if (
taskList[i]->priorityClass != 0)
MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.bottom-1), priorityIndicatorColor, priorityIndicatorColor, GetPixel(hdc, r.right-1, r.bottom-1), 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1304 else MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.bottom-1), stickyIndicatorColor, stickyIndicatorColor, GetPixel(hdc, r.right-1, r.bottom-1), 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1305
1307 InflateRect(&r, 0, -(highPrioIndicatorSize*2));
1308 if (
taskList[i]->active)
MakeGradientSuper(hdc, r,
pSettings->
ActiveTask->
type,
pSettings->
ActiveTask->Color1,
pSettings->
ActiveTask->Color2,
pSettings->
ActiveTask->
Color3,
pSettings->
ActiveTask->
Color4,
pSettings->
ActiveTask->
Color5,
pSettings->
ActiveTask->
Color6,
pSettings->
ActiveTask->
Color7,
pSettings->
ActiveTask->
Color8,
pSettings->
ActiveTask->
interlaced,
pSettings->
ActiveTask->
bevelstyle,
pSettings->
ActiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
ActiveTask->
borderColor,
pSettings->
ActiveTask->
borderWidth);
1309 else if (
pSettings->
taskbarInactiveBackground)
MakeGradientSuper(hdc, r,
pSettings->
InactiveTask->
type,
pSettings->
InactiveTask->Color1,
pSettings->
InactiveTask->Color2,
pSettings->
InactiveTask->
Color3,
pSettings->
InactiveTask->
Color4,
pSettings->
InactiveTask->
Color5,
pSettings->
InactiveTask->
Color6,
pSettings->
InactiveTask->
Color7,
pSettings->
InactiveTask->
Color8,
pSettings->
InactiveTask->
interlaced,
pSettings->
InactiveTask->
bevelstyle,
pSettings->
InactiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
InactiveTask->
borderColor,
pSettings->
InactiveTask->
borderWidth);
1310 }
1312 {
1313
1314 MakeGradientSuper(hdc,
currentTaskButton,
pSettings->
ActiveTask->
type,
pSettings->
FlashingTask->Color1,
pSettings->
FlashingTask->Color2,
pSettings->
FlashingTask->
Color3,
pSettings->
FlashingTask->
Color4,
pSettings->
FlashingTask->
Color5,
pSettings->
FlashingTask->
Color6,
pSettings->
FlashingTask->
Color7,
pSettings->
FlashingTask->
Color8,
pSettings->
InactiveTask->
interlaced,
pSettings->
ActiveTask->
bevelstyle,
pSettings->
ActiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
FlashingTask->
borderColor,
pSettings->
ActiveTask->
borderWidth);
1315 }
1316
1318 {
1319
1320
1321 if (
taskList[i]->active)
MakeGradientSuper(hdc,
currentTaskButton,
pSettings->
ActiveTask->
type,
pSettings->
ActiveTask->Color1,
pSettings->
ActiveTask->Color2,
pSettings->
ActiveTask->
Color3,
pSettings->
ActiveTask->
Color4,
pSettings->
ActiveTask->
Color5,
pSettings->
ActiveTask->
Color6,
pSettings->
ActiveTask->
Color7,
pSettings->
ActiveTask->
Color8,
pSettings->
ActiveTask->
interlaced,
pSettings->
ActiveTask->
bevelstyle,
pSettings->
ActiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
ActiveTask->
borderColor,
pSettings->
ActiveTask->
borderWidth);
1322 else if (
pSettings->
taskbarInactiveBackground)
MakeGradientSuper(hdc,
currentTaskButton,
pSettings->
InactiveTask->
type,
pSettings->
InactiveTask->Color1,
pSettings->
InactiveTask->Color2,
pSettings->
InactiveTask->
Color3,
pSettings->
InactiveTask->
Color4,
pSettings->
InactiveTask->
Color5,
pSettings->
InactiveTask->
Color6,
pSettings->
InactiveTask->
Color7,
pSettings->
InactiveTask->
Color8,
pSettings->
InactiveTask->
interlaced,
pSettings->
InactiveTask->
bevelstyle,
pSettings->
InactiveTask->
bevelposition,
pSettings->
bevelWidth,
pSettings->
InactiveTask->
borderColor,
pSettings->
InactiveTask->
borderWidth);
1323 }
1324 else
1325 {
1326
1329 }
1330
1331
1332
1334 {
1335
1338 }
1339
1340
1341
1343
1344
1346 {
1347
1351
1353 {
1355 }
1356 else
1357 {
1359 {
1362 }
1365 }
1366
1367
1369 {
1370
1372 InflateRect(&
iconRect, -padding, 0);
1373 }
1374 else
1375 {
1376
1378 }
1379
1383
1384
1386 {
1389 }
1390
1392 }
1393
1394
1395
1396
1397
1400
1401
1403 {
1404 HFONT font = CreateFont(
pSettings->
Toolbar->
FontHeight, 0, 0, 0,
pSettings->
Toolbar->
FontWeight,
false,
false,
false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
pSettings->
Toolbar->
Font);
1405 HGDIOBJ oldfont = SelectObject(hdc, font);
1406 SetBkMode(hdc, TRANSPARENT);
1407
1409 InflateRect(&
textRect, -padding, 0);
1411 {
1412
1415 }
1416
1417
1418 wchar_t currentTaskButtonCaption[275];
1420 {
1422 {
1423
1424 wcscpy(currentTaskButtonCaption, L"[_] ");
1425 }
1427 {
1429 wcscpy(currentTaskButtonCaption, L"[*] ");
1430 }
1431 else
1432 {
1434 swprintf(currentTaskButtonCaption,
sizeof(currentTaskButtonCaption), L
"[%d] ",
taskList[i]->workspace + 1);
1435 }
1436 wcscat(currentTaskButtonCaption,
taskList[i]->captionUnicode);
1437 }
1438 else wcscpy(currentTaskButtonCaption,
taskList[i]->captionUnicode);
1439
1440 unsigned int flags = DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS;
1441 if (
taskList[i]->hwnd ==
flashingHwnd)
DrawTextWithEffectsUnicode(hdc,
textRect, currentTaskButtonCaption, flags,
pSettings->
FlashingTask->
TextColor,
pSettings->
ActiveTask->
FontOutline,
pSettings->
FlashingTask->
OutlineColor,
pSettings->
ActiveTask->
FontShadow,
pSettings->
FlashingTask->
ShadowColor,
pSettings->
ActiveTask->
ShadowX,
pSettings->
ActiveTask->
ShadowY);
1442 else if (
taskList[i]->active)
DrawTextWithEffectsUnicode(hdc,
textRect, currentTaskButtonCaption, flags,
pSettings->
ActiveTask->
TextColor,
pSettings->
ActiveTask->
FontOutline,
pSettings->
ActiveTask->
OutlineColor,
pSettings->
ActiveTask->
FontShadow,
pSettings->
ActiveTask->
ShadowColor,
pSettings->
ActiveTask->
ShadowX,
pSettings->
ActiveTask->
ShadowY);
1443 else DrawTextWithEffectsUnicode(hdc,
textRect, currentTaskButtonCaption, flags,
pSettings->
InactiveTask->
TextColor,
pSettings->
InactiveTask->
FontOutline,
pSettings->
InactiveTask->
OutlineColor,
pSettings->
InactiveTask->
FontShadow,
pSettings->
InactiveTask->
ShadowColor,
pSettings->
InactiveTask->
ShadowX,
pSettings->
InactiveTask->
ShadowY);
1444
1445 DeleteObject(SelectObject(hdc, oldfont));
1446
1447
1449 {
1451 if (SUCCEEDED(hr))
1452 {
1453
1454
1455
1456 RECT thumbnailRect;
1457 CopyRect(&thumbnailRect, &
textRect);
1458 InflateRect(&thumbnailRect, 0, -(padding/2));
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476 DWM_THUMBNAIL_PROPERTIES dskThumbProps;
1477 dskThumbProps.dwFlags = DWM_TNP_RECTDESTINATION | DWM_TNP_OPACITY | DWM_TNP_VISIBLE | DWM_TNP_SOURCECLIENTAREAONLY;
1478 dskThumbProps.rcDestination = thumbnailRect;
1479 dskThumbProps.opacity = 255;
1480 dskThumbProps.fVisible = TRUE;
1481 dskThumbProps.fSourceClientAreaOnly = FALSE;
1483 }
1484 }
1485 }
1486
1487
1488
1490
1491
1493
1494 drawnTasks++;
1495 }
1496
1497
1498
1499
1500
1501
1503 {
1504 RECT r;
1507
1508 COLORREF beginIndicatorColor = GetPixel(hdc, r.left, r.top);
1509 COLORREF endIndicatorColor = GetPixel(hdc, r.right-1, r.bottom-1);
1510
1511 int centerX = r.left + ((r.right - r.left) / 2);
1512 int centerY = r.top + ((r.bottom - r.top) / 2);
1514
1515 if (
pSettings->
toolbarVertical)
MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1516 else MakeGradientSuper(hdc, r,
B_SPLITVERTICAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1517 }
1518
1519 for (
int i = (lastButton+1); i < (int)
taskList.size(); i++)
1520 {
1522 else
1523 {
1524 RECT r;
1527
1528 COLORREF beginIndicatorColor = GetPixel(hdc, r.left, r.top);
1529 COLORREF endIndicatorColor = GetPixel(hdc, r.right-1, r.bottom-1);
1530
1531 int centerX = r.left + ((r.right - r.left) / 2);
1532 int centerY = r.top + ((r.bottom - r.top) / 2);
1534
1535 if (
pSettings->
toolbarVertical)
MakeGradientSuper(hdc, r,
B_SPLITHORIZONTAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1536 else MakeGradientSuper(hdc, r,
B_SPLITVERTICAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0,
false,
BEVEL_FLAT,
BEVEL1, 0, 0, 0);
1537
1538 break;
1539 }
1540 }
1541
1542 return 1;
1543}
void MakeGradientSuper(HDC hdc, RECT rect, int type, COLORREF color1, COLORREF color2, COLORREF color3, COLORREF color4, COLORREF color5, COLORREF color6, COLORREF color7, COLORREF color8, bool bInterlaced, int bevelStyle, int bevelPosition, int bevelWidth, COLORREF borderColour, int borderWidth)
Definition BBApi.cpp:2127
void DrawTextWithEffectsUnicode(HDC hdc, RECT r, LPWSTR text, unsigned int format, COLORREF textColor, bool outline, COLORREF outlineColor, bool shadow, COLORREF shadowColor, int shadowX, int shadowY)
Definition BBApi.cpp:3528
void DrawSatHueIcon(HDC hdc, RECT r, HICON icon, int size, int saturation, int hue)
Definition BBApi.cpp:3765
#define BEVEL1
Definition BBApi.h:108
#define BEVEL_FLAT
Definition BBApi.h:105
#define B_SPLITHORIZONTAL
Definition BBApi.h:86
#define B_SPLITVERTICAL
Definition BBApi.h:87
Toolbar * pToolbar
Definition Blackbox.cpp:48
#define TASKBAR_MODE_BARS
Definition Settings.h:43
#define TASKBAR_MODE_BARSICONS
Definition Settings.h:44
#define TASKBAR_MODE_ICONS
Definition Settings.h:45
int scalingFactorHiDPI
Definition Settings.h:327
StyleItem * ActiveTask
Definition Settings.h:448
unsigned int taskbarSaturationValue
Definition Settings.h:221
COLORREF MixColors(COLORREF colorA, COLORREF colorB)
Definition Settings.cpp:2231
bool taskbarInactiveBackground
Definition Settings.h:226
unsigned int taskbarHueIntensity
Definition Settings.h:222
int bevelWidth
Definition Settings.h:564
bool taskbarShowTaskWorkspace
Definition Settings.h:218
StyleItem * FlashingTask
Definition Settings.h:450
bool taskbarActiveLivePreview
Definition Settings.h:225
StyleItem * InactiveTask
Definition Settings.h:449
bool taskbarActiveSatHue
Definition Settings.h:223
RECT iconRect
Definition Taskbar.h:137
RECT ActiveTaskRect
Definition Taskbar.h:129
RECT textRect
Definition Taskbar.h:137
HWND currentTaskButtonWnd
Definition Taskbar.h:132
HICON currentTaskButtonIcon
Definition Taskbar.h:133
RECT currentTaskButton
Definition Taskbar.h:131
int iconSize
Definition Taskbar.h:136
int borderWidth
Definition BBApi.h:417
COLORREF Color5
Definition BBApi.h:436
int bevelstyle
Definition BBApi.h:400
COLORREF Color4
Definition BBApi.h:434
COLORREF Color6
Definition BBApi.h:437
int type
Definition BBApi.h:402
int bevelposition
Definition BBApi.h:401
COLORREF Color7
Definition BBApi.h:438
COLORREF Color8
Definition BBApi.h:439
bool interlaced
Definition BBApi.h:404
COLORREF Color3
Definition BBApi.h:433
COLORREF borderColor
Definition BBApi.h:418
int marginWidth
Definition BBApi.h:416