mirror of
https://github.com/vale981/tdesktop
synced 2025-03-07 02:31:41 -05:00
Version 0.10.9: fixed interface scaling and Windows build.
This commit is contained in:
parent
ef2faf676e
commit
4a5f467560
6 changed files with 10 additions and 15 deletions
|
@ -23,6 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
|
|
||||||
#include "dialogs/dialogs_layout.h"
|
#include "dialogs/dialogs_layout.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
|
#include "ui/popupmenu.h"
|
||||||
#include "zip.h"
|
#include "zip.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "shortcuts.h"
|
#include "shortcuts.h"
|
||||||
|
|
|
@ -27,6 +27,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "localstorage.h"
|
#include "localstorage.h"
|
||||||
|
#include "ui/popupmenu.h"
|
||||||
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
|
|
||||||
|
@ -143,19 +144,10 @@ public:
|
||||||
QImage cornersImage(_fullsize, _fullsize, QImage::Format_ARGB32_Premultiplied);
|
QImage cornersImage(_fullsize, _fullsize, QImage::Format_ARGB32_Premultiplied);
|
||||||
{
|
{
|
||||||
Painter p(&cornersImage);
|
Painter p(&cornersImage);
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
st::wndShadow.paint(p, 0, 0, _fullsize);
|
st::wndShadow.paint(p, 0, 0, _fullsize);
|
||||||
}
|
}
|
||||||
if (rtl()) cornersImage = cornersImage.mirrored(true, false);
|
if (rtl()) cornersImage = cornersImage.mirrored(true, false);
|
||||||
uchar *bits = cornersImage.bits();
|
|
||||||
if (bits) {
|
|
||||||
for (
|
|
||||||
quint32 *p = (quint32*)bits, *end = (quint32*)(bits + cornersImage.byteCount());
|
|
||||||
p < end;
|
|
||||||
++p
|
|
||||||
) {
|
|
||||||
*p = (*p ^ 0x00ffffff) << 24;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_metaSize = _fullsize + 2 * _shift;
|
_metaSize = _fullsize + 2 * _shift;
|
||||||
_alphas.reserve(_metaSize);
|
_alphas.reserve(_metaSize);
|
||||||
|
|
|
@ -21,10 +21,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "window/main_window.h"
|
#include "window/main_window.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
class NotifyWindow;
|
class NotifyWindow;
|
||||||
|
class PopupMenu;
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ SysBtn::SysBtn(QWidget *parent, const style::sysButton &st, const QString &text)
|
||||||
, _st(st)
|
, _st(st)
|
||||||
, a_color(_st.color->c)
|
, a_color(_st.color->c)
|
||||||
, _a_color(animation(this, &SysBtn::step_color))
|
, _a_color(animation(this, &SysBtn::step_color))
|
||||||
, _overLevel(0)
|
|
||||||
, _text(text) {
|
, _text(text) {
|
||||||
int32 w = _st.size.width() + (_text.isEmpty() ? 0 : ((_st.size.width() - _st.icon.width()) / 2 + st::titleTextButton.font->width(_text)));
|
int32 w = _st.size.width() + (_text.isEmpty() ? 0 : ((_st.size.width() - _st.icon.width()) / 2 + st::titleTextButton.font->width(_text)));
|
||||||
resize(w, _st.size.height());
|
resize(w, _st.size.height());
|
||||||
|
|
|
@ -68,7 +68,7 @@ protected:
|
||||||
anim::cvalue a_color;
|
anim::cvalue a_color;
|
||||||
Animation _a_color;
|
Animation _a_color;
|
||||||
|
|
||||||
float64 _overLevel;
|
float64 _overLevel = 0.;
|
||||||
QString _text;
|
QString _text;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,8 +32,11 @@ uint32 colorKey(const QColor &c) {
|
||||||
using IconPixmaps = QMap<QPair<const IconMask*, uint32>, QPixmap>;
|
using IconPixmaps = QMap<QPair<const IconMask*, uint32>, QPixmap>;
|
||||||
NeverFreedPointer<IconPixmaps> iconPixmaps;
|
NeverFreedPointer<IconPixmaps> iconPixmaps;
|
||||||
|
|
||||||
int pxAdjust(int value, int scale) {
|
inline int pxAdjust(int value, int scale) {
|
||||||
return qRound((value * scale) / 4. - 0.01);
|
if (value < 0) {
|
||||||
|
return -pxAdjust(-value, scale);
|
||||||
|
}
|
||||||
|
return qFloor((value * scale / 4.) + 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap createIconPixmap(const IconMask *mask, const Color &color) {
|
QPixmap createIconPixmap(const IconMask *mask, const Color &color) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue