mirror of https://github.com/procxx/kepka.git
icon with padding when large, without padding when small
This commit is contained in:
parent
47a91e5d5f
commit
7efb5df35c
|
@ -146,15 +146,15 @@ struct BuiltInDc {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const BuiltInDc _builtInDcs[] = {
|
static const BuiltInDc _builtInDcs[] = {
|
||||||
{ 1, "149.154.175.50", 443 },
|
{ 1, "149.154.175.50", 443 },
|
||||||
{ 2, "149.154.167.51", 443 },
|
{ 2, "149.154.167.51", 443 },
|
||||||
{ 3, "174.140.142.6", 443 },
|
{ 3, "174.140.142.6", 443 },
|
||||||
{ 4, "149.154.167.91", 443 },
|
{ 4, "149.154.167.91", 443 },
|
||||||
{ 5, "149.154.171.5", 443 }
|
{ 5, "149.154.171.5", 443 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const BuiltInDc _builtInTestDcs[] = {
|
static const BuiltInDc _builtInTestDcs[] = {
|
||||||
{ 1, "173.240.5.253", 443 }
|
{ 1, "173.240.5.253", 443 }
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const BuiltInDc *builtInDcs() {
|
inline const BuiltInDc *builtInDcs() {
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace {
|
||||||
};
|
};
|
||||||
|
|
||||||
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
|
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
|
||||||
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), wndIcon(QPixmap::fromImage(icon256)) {
|
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QPixmap::fromImage(icon256)) {
|
||||||
connect(&psIdleTimer, SIGNAL(timeout()), this, SLOT(psIdleTimeout()));
|
connect(&psIdleTimer, SIGNAL(timeout()), this, SLOT(psIdleTimeout()));
|
||||||
psIdleTimer.setSingleShot(false);
|
psIdleTimer.setSingleShot(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ protected:
|
||||||
bool posInited;
|
bool posInited;
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
QMenu *trayIconMenu;
|
QMenu *trayIconMenu;
|
||||||
QImage icon256;
|
QImage icon256, iconbig256;
|
||||||
QIcon wndIcon;
|
QIcon wndIcon;
|
||||||
|
|
||||||
virtual void setupTrayIcon() = 0;
|
virtual void setupTrayIcon() = 0;
|
||||||
|
|
|
@ -71,7 +71,7 @@ void MacPrivate::notifyReplied(unsigned long long peer, const char *str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
|
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
|
||||||
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), wndIcon(QPixmap(qsl(":/gui/art/iconbig256.png"))),
|
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(iconbig256)),
|
||||||
psLogout(0), psUndo(0), psRedo(0), psCut(0), psCopy(0), psPaste(0), psDelete(0), psSelectAll(0), psContacts(0), psAddContact(0), psNewGroup(0), psShowTelegram(0) {
|
psLogout(0), psUndo(0), psRedo(0), psCut(0), psCopy(0), psPaste(0), psDelete(0), psSelectAll(0), psContacts(0), psAddContact(0), psNewGroup(0), psShowTelegram(0) {
|
||||||
QImage tray(qsl(":/gui/art/osxtray.png"));
|
QImage tray(qsl(":/gui/art/osxtray.png"));
|
||||||
trayImg = tray.copy(0, cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4));
|
trayImg = tray.copy(0, cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4));
|
||||||
|
|
|
@ -111,7 +111,7 @@ protected:
|
||||||
bool posInited;
|
bool posInited;
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
QMenu *trayIconMenu;
|
QMenu *trayIconMenu;
|
||||||
QImage icon256;
|
QImage icon256, iconbig256;
|
||||||
QIcon wndIcon;
|
QIcon wndIcon;
|
||||||
|
|
||||||
QImage trayImg, trayImgSel;
|
QImage trayImg, trayImgSel;
|
||||||
|
|
|
@ -860,7 +860,7 @@ namespace {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), ps_hWnd(0), ps_menu(0), icon256(qsl(":/gui/art/icon256.png")), wndIcon(QPixmap::fromImage(icon256)),
|
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), ps_hWnd(0), ps_menu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(icon256)),
|
||||||
ps_iconBig(0), ps_iconSmall(0), ps_iconOverlay(0), trayIcon(0), trayIconMenu(0), posInited(false), ps_tbHider_hWnd(createTaskbarHider()), psIdle(false) {
|
ps_iconBig(0), ps_iconSmall(0), ps_iconOverlay(0), trayIcon(0), trayIconMenu(0), posInited(false), ps_tbHider_hWnd(createTaskbarHider()), psIdle(false) {
|
||||||
tbCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated");
|
tbCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated");
|
||||||
connect(&psIdleTimer, SIGNAL(timeout()), this, SLOT(psIdleTimeout()));
|
connect(&psIdleTimer, SIGNAL(timeout()), this, SLOT(psIdleTimeout()));
|
||||||
|
|
|
@ -86,7 +86,7 @@ protected:
|
||||||
bool posInited;
|
bool posInited;
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
ContextMenu *trayIconMenu;
|
ContextMenu *trayIconMenu;
|
||||||
QImage icon256;
|
QImage icon256, iconbig256;
|
||||||
QIcon wndIcon;
|
QIcon wndIcon;
|
||||||
|
|
||||||
virtual void setupTrayIcon() = 0;
|
virtual void setupTrayIcon() = 0;
|
||||||
|
|
|
@ -336,6 +336,9 @@ _connecting(0), _clearManager(0), dragging(false), _inactivePress(false), _media
|
||||||
icon16 = icon256.scaledToWidth(16, Qt::SmoothTransformation);
|
icon16 = icon256.scaledToWidth(16, Qt::SmoothTransformation);
|
||||||
icon32 = icon256.scaledToWidth(32, Qt::SmoothTransformation);
|
icon32 = icon256.scaledToWidth(32, Qt::SmoothTransformation);
|
||||||
icon64 = icon256.scaledToWidth(64, Qt::SmoothTransformation);
|
icon64 = icon256.scaledToWidth(64, Qt::SmoothTransformation);
|
||||||
|
iconbig16 = iconbig256.scaledToWidth(16, Qt::SmoothTransformation);
|
||||||
|
iconbig32 = iconbig256.scaledToWidth(32, Qt::SmoothTransformation);
|
||||||
|
iconbig64 = iconbig256.scaledToWidth(64, Qt::SmoothTransformation);
|
||||||
|
|
||||||
if (objectName().isEmpty()) {
|
if (objectName().isEmpty()) {
|
||||||
setObjectName(qsl("MainWindow"));
|
setObjectName(qsl("MainWindow"));
|
||||||
|
@ -1298,7 +1301,7 @@ void Window::notifyActivateAll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage Window::iconLarge() const {
|
QImage Window::iconLarge() const {
|
||||||
return icon256;
|
return iconbig256;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color) {
|
void Window::placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color) {
|
||||||
|
@ -1389,7 +1392,7 @@ QImage Window::iconWithCounter(int size, int count, style::color bg, bool smallI
|
||||||
if (size != 16 && size != 32) size = 64;
|
if (size != 16 && size != 32) size = 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage img((size == 16) ? icon16 : (size == 32 ? icon32 : icon64));
|
QImage img(smallIcon ? ((size == 16) ? iconbig16 : (size == 32 ? iconbig32 : iconbig64)) : ((size == 16) ? icon16 : (size == 32 ? icon32 : icon64)));
|
||||||
if (!count) return img;
|
if (!count) return img;
|
||||||
|
|
||||||
if (smallIcon) {
|
if (smallIcon) {
|
||||||
|
|
|
@ -261,7 +261,7 @@ private:
|
||||||
|
|
||||||
void placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color);
|
void placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color);
|
||||||
QImage iconWithCounter(int size, int count, style::color bg, bool smallIcon);
|
QImage iconWithCounter(int size, int count, style::color bg, bool smallIcon);
|
||||||
QImage icon16, icon32, icon64;
|
QImage icon16, icon32, icon64, iconbig16, iconbig32, iconbig64;
|
||||||
|
|
||||||
QWidget *centralwidget;
|
QWidget *centralwidget;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue