nheko/src/Config.h

49 lines
1.4 KiB
C
Raw Normal View History

2021-03-05 00:35:15 +01:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
// SPDX-FileCopyrightText: 2023 Nheko Contributors
2021-03-05 00:35:15 +01:00
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QRegularExpression>
2017-12-24 12:13:07 +01:00
#include <QString>
2021-12-28 22:30:12 +01:00
// clazy:excludeall=non-pod-global-static
// Non-theme app configuration. Layouts, fonts spacing etc.
//
// Font sizes are in pixels.
2017-10-15 21:08:51 +02:00
namespace conf {
namespace modals {
2022-03-30 06:53:55 +02:00
constexpr int WIDGET_MARGIN = 20;
constexpr int WIDGET_SPACING = 15;
2018-09-25 13:41:47 +02:00
constexpr auto LABEL_MEDIUM_SIZE_RATIO = 1.3;
}
2017-12-24 12:13:07 +01:00
namespace strings {
2021-12-28 22:30:12 +01:00
const QString url_html = QStringLiteral("<a href=\"\\1\">\\1</a>");
const QRegularExpression url_regex(
// match an URL, that is not quoted, i.e.
// vvvvvv match quote via negative lookahead/lookbehind vv
// vvvv atomic match url -> fail if there is a " before or after vvv
2021-12-28 22:30:12 +01:00
QStringLiteral(
R"((?<!["'])(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!["']))"));
// A matrix link to be converted back to markdown
2021-12-29 00:36:43 +01:00
static const QRegularExpression
matrixToLink(QStringLiteral(R"(<a href=\"(https://matrix.to/#/.*?)\">(.*?)</a>)"));
2017-12-24 12:13:07 +01:00
}
// Window geometry.
2017-10-15 21:08:51 +02:00
namespace window {
2022-03-30 06:53:55 +02:00
constexpr int height = 600;
constexpr int width = 1066;
constexpr int minHeight = 340;
constexpr int minWidth = 340;
2017-10-15 21:08:51 +02:00
} // namespace window
2017-08-20 12:47:22 +02:00
} // namespace conf