mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed indents in some files.
This commit is contained in:
parent
582df3f39f
commit
6ae15ff264
4 changed files with 18 additions and 18 deletions
|
@ -107,9 +107,9 @@ int32 *hashSha1(const void *data, uint32 len, void *dest) {
|
||||||
for (end = block + 64; block + 64 <= len; end = block + 64) {
|
for (end = block + 64; block + 64 <= len; end = block + 64) {
|
||||||
for (uint32 i = 0; block < end; block += 4) {
|
for (uint32 i = 0; block < end; block += 4) {
|
||||||
temp[i++] = (uint32) buf[block + 3]
|
temp[i++] = (uint32) buf[block + 3]
|
||||||
| (((uint32) buf[block + 2]) << 8)
|
| (((uint32) buf[block + 2]) << 8)
|
||||||
| (((uint32) buf[block + 1]) << 16)
|
| (((uint32) buf[block + 1]) << 16)
|
||||||
| (((uint32) buf[block]) << 24);
|
| (((uint32) buf[block]) << 24);
|
||||||
}
|
}
|
||||||
sha1PartHash(sha, temp);
|
sha1PartHash(sha, temp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ constexpr auto kSharedMediaLimit = 100;
|
||||||
return (quint32(std::clamp(color.red(), 0, 255)) << 16)
|
return (quint32(std::clamp(color.red(), 0, 255)) << 16)
|
||||||
| (quint32(std::clamp(color.green(), 0, 255)) << 8)
|
| (quint32(std::clamp(color.green(), 0, 255)) << 8)
|
||||||
| quint32(std::clamp(color.blue(), 0, 255));
|
| quint32(std::clamp(color.blue(), 0, 255));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto mtpColors = QVector<MTPint>();
|
auto mtpColors = QVector<MTPint>();
|
||||||
mtpColors.reserve(colors.size());
|
mtpColors.reserve(colors.size());
|
||||||
|
|
|
@ -660,7 +660,7 @@ void Widget::setupSupportMode() {
|
||||||
|
|
||||||
void Widget::setupMainMenuToggle() {
|
void Widget::setupMainMenuToggle() {
|
||||||
_mainMenu.under->setClickedCallback([=] {
|
_mainMenu.under->setClickedCallback([=] {
|
||||||
_mainMenu.toggle->clicked({}, Qt::LeftButton);
|
_mainMenu.toggle->clicked({}, Qt::LeftButton);
|
||||||
});
|
});
|
||||||
_mainMenu.under->stackUnder(_mainMenu.toggle);
|
_mainMenu.under->stackUnder(_mainMenu.toggle);
|
||||||
_mainMenu.toggle->setClickedCallback([=] { showMainMenu(); });
|
_mainMenu.toggle->setClickedCallback([=] { showMainMenu(); });
|
||||||
|
|
|
@ -41,29 +41,29 @@ namespace {
|
||||||
[[nodiscard]] QImage ImageFromNS(NSImage *icon) {
|
[[nodiscard]] QImage ImageFromNS(NSImage *icon) {
|
||||||
CGImageRef image = [icon CGImageForProposedRect:NULL context:nil hints:nil];
|
CGImageRef image = [icon CGImageForProposedRect:NULL context:nil hints:nil];
|
||||||
|
|
||||||
const int width = CGImageGetWidth(image);
|
const int width = CGImageGetWidth(image);
|
||||||
const int height = CGImageGetHeight(image);
|
const int height = CGImageGetHeight(image);
|
||||||
auto result = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
|
auto result = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
|
||||||
result.fill(Qt::transparent);
|
result.fill(Qt::transparent);
|
||||||
|
|
||||||
CGColorSpaceRef space = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
|
CGColorSpaceRef space = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
|
||||||
CGBitmapInfo info = CGBitmapInfo(kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Host;
|
CGBitmapInfo info = CGBitmapInfo(kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Host;
|
||||||
CGContextRef context = CGBitmapContextCreate(
|
CGContextRef context = CGBitmapContextCreate(
|
||||||
result.bits(),
|
result.bits(),
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
8,
|
8,
|
||||||
result.bytesPerLine(),
|
result.bytesPerLine(),
|
||||||
space,
|
space,
|
||||||
info);
|
info);
|
||||||
|
|
||||||
CGRect rect = CGRectMake(0, 0, width, height);
|
CGRect rect = CGRectMake(0, 0, width, height);
|
||||||
CGContextDrawImage(context, rect, image);
|
CGContextDrawImage(context, rect, image);
|
||||||
|
|
||||||
CFRelease(space);
|
CFRelease(space);
|
||||||
CFRelease(context);
|
CFRelease(context);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] QImage ResolveBundleIconDefault() {
|
[[nodiscard]] QImage ResolveBundleIconDefault() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue