From 4a3df752449b20dcd7df7aab611da6963168660e Mon Sep 17 00:00:00 2001 From: gastoner <46690189+gastoner@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:19:13 +0200 Subject: [PATCH 1/2] Swap theme from the Adwaita to Fusion (#659) --- .github/workflows/ccpp.yml | 9 - CMakeLists.txt | 4 - dist/fedora/mediawriter.spec | 7 - dist/flatpak/fmw-paths.patch | 14 - .../org.fedoraproject.MediaWriter.json | 22 - src/CMakeLists.txt | 3 - src/app/CMakeLists.txt | 5 - src/app/main.cpp | 15 - src/theme/CMakeLists.txt | 23 - src/theme/adwaitathemeplugin.cpp | 42 -- src/theme/adwaitathemeplugin.h | 35 -- src/theme/icon.cpp | 515 ------------------ src/theme/icon.h | 189 ------- src/theme/qml/Button.qml | 87 --- src/theme/qml/CheckBox.qml | 57 -- src/theme/qml/CheckIndicator.qml | 85 --- src/theme/qml/ComboBox.qml | 165 ------ src/theme/qml/Label.qml | 41 -- src/theme/qml/MenuItem.qml | 116 ---- src/theme/qml/ProgressBar.qml | 80 --- src/theme/qml/RadioButton.qml | 57 -- src/theme/qml/RadioIndicator.qml | 71 --- src/theme/qml/ScrollBar.qml | 67 --- src/theme/qml/TextField.qml | 77 --- src/theme/qml/private/ButtonFrame.qml | 66 --- src/theme/qml/qmldir | 27 - src/theme/qmldir | 2 - src/theme/theme.cpp | 229 -------- src/theme/theme.h | 257 --------- src/theme/theme.pro | 46 -- 30 files changed, 2413 deletions(-) delete mode 100644 dist/flatpak/fmw-paths.patch delete mode 100644 src/theme/CMakeLists.txt delete mode 100644 src/theme/adwaitathemeplugin.cpp delete mode 100644 src/theme/adwaitathemeplugin.h delete mode 100644 src/theme/icon.cpp delete mode 100644 src/theme/icon.h delete mode 100644 src/theme/qml/Button.qml delete mode 100644 src/theme/qml/CheckBox.qml delete mode 100644 src/theme/qml/CheckIndicator.qml delete mode 100644 src/theme/qml/ComboBox.qml delete mode 100644 src/theme/qml/Label.qml delete mode 100644 src/theme/qml/MenuItem.qml delete mode 100644 src/theme/qml/ProgressBar.qml delete mode 100644 src/theme/qml/RadioButton.qml delete mode 100644 src/theme/qml/RadioIndicator.qml delete mode 100644 src/theme/qml/ScrollBar.qml delete mode 100644 src/theme/qml/TextField.qml delete mode 100644 src/theme/qml/private/ButtonFrame.qml delete mode 100644 src/theme/qml/qmldir delete mode 100644 src/theme/qmldir delete mode 100644 src/theme/theme.cpp delete mode 100644 src/theme/theme.h delete mode 100644 src/theme/theme.pro diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index bcd3d602..94cfcc89 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -29,15 +29,6 @@ jobs: uses: jurplel/install-qt-action@v3 with: version: ${{env.QT_VERSION}} - - name: Install Adwaita-qt - run: | - git clone https://github.com/FedoraQt/adwaita-qt.git adwaita-qt - cd adwaita-qt - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=ON - make -j2 - sudo make install - name: Build run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 11fec105..ccff6c8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,6 @@ endif() find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Gui Network Svg Qml Quick QuickControls2 Widgets) -if (UNIX AND NOT APPLE) - find_package(AdwaitaQt6 "1.4.2" REQUIRED) -endif() - add_subdirectory(src) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/dist/fedora/mediawriter.spec b/dist/fedora/mediawriter.spec index cdff3d6a..99e59efd 100644 --- a/dist/fedora/mediawriter.spec +++ b/dist/fedora/mediawriter.spec @@ -15,7 +15,6 @@ BuildRequires: gettext BuildRequires: cmake BuildRequires: make BuildRequires: libappstream-glib -BuildRequires: libadwaita-qt6-devel BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qtdeclarative-devel BuildRequires: xz-devel @@ -43,9 +42,6 @@ like flash drives or memory cards. %prep %autosetup -p1 -n MediaWriter-%{version} -# Install the theme into correct prefix when building for /app -sed -i 's@\${QT6_INSTALL_QML}@%{_qt6_qmldir}@' src/theme/CMakeLists.txt - %build %cmake @@ -71,9 +67,6 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/org.fedo %{_datadir}/icons/hicolor/128x128/apps/org.fedoraproject.MediaWriter.png %{_datadir}/icons/hicolor/256x256/apps/org.fedoraproject.MediaWriter.png %{_datadir}/icons/hicolor/512x512/apps/org.fedoraproject.MediaWriter.png -%{_qt6_qmldir}/QtQuick/Controls/org/fedoraproject/AdwaitaTheme/ -%{_qt6_qmldir}/org/fedoraproject/AdwaitaTheme/libadwaitathemeplugin.so -%{_qt6_qmldir}/org/fedoraproject/AdwaitaTheme/qmldir %changelog * Mon May 09 06 2022 Jan Grulich - 5.0.0-1 diff --git a/dist/flatpak/fmw-paths.patch b/dist/flatpak/fmw-paths.patch deleted file mode 100644 index 84392a8a..00000000 --- a/dist/flatpak/fmw-paths.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/theme/CMakeLists.txt b/src/theme/CMakeLists.txt -index de208fd..7291536 100644 ---- a/src/theme/CMakeLists.txt -+++ b/src/theme/CMakeLists.txt -@@ -23,6 +23,6 @@ target_link_libraries(adwaitathemeplugin - ${ADWAITAQT_LIBRARIES} - ) - --install(TARGETS adwaitathemeplugin DESTINATION ${QT6_INSTALL_QML}/org/fedoraproject/AdwaitaTheme) --install(FILES qmldir DESTINATION ${QT6_INSTALL_QML}/org/fedoraproject/AdwaitaTheme) --install(DIRECTORY qml/ DESTINATION ${QT6_INSTALL_QML}/QtQuick/Controls/org/fedoraproject/AdwaitaTheme) -+install(TARGETS adwaitathemeplugin DESTINATION /app/lib/qt6/qml/org/fedoraproject/AdwaitaTheme) -+install(FILES qmldir DESTINATION /app/lib/qt6/qml/org/fedoraproject/AdwaitaTheme) -+install(DIRECTORY qml/ DESTINATION /app/lib/qt6/qml/QtQuick/Controls/org/fedoraproject/AdwaitaTheme) diff --git a/dist/flatpak/org.fedoraproject.MediaWriter.json b/dist/flatpak/org.fedoraproject.MediaWriter.json index 8ee75c28..1146bfce 100644 --- a/dist/flatpak/org.fedoraproject.MediaWriter.json +++ b/dist/flatpak/org.fedoraproject.MediaWriter.json @@ -21,24 +21,6 @@ "/lib/pkgconfig" ], "modules": [ - { - "name": "Adwaita-qt", - "buildsystem": "cmake", - "config-opts": ["-DUSE_QT6=ON"], - "sources": [ - { - "type": "git", - "url": "https://github.com/FedoraQt/adwaita-qt.git", - "tag": "1.4.2" - }, - { - "type": "shell", - "commands": [ - "sed -i 's@add_subdirectory(style)@#add_subdirectory(style)@' src/CMakeLists.txt" - ] - } - ] - }, { "name": "MediaWriter", "buildsystem": "cmake", @@ -47,10 +29,6 @@ "type": "git", "url": "https://github.com/FedoraQt/MediaWriter.git", "branch": "main" - }, - { - "type": "patch", - "path": "fmw-paths.patch" } ] } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7b1b2c54..262304c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,3 @@ add_subdirectory(helper) add_subdirectory(app) add_subdirectory(lib) -if (UNIX AND NOT APPLE) - add_subdirectory(theme) -endif() diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index cf869e0a..2442b343 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -1,8 +1,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/lib - ${CMAKE_SOURCE_DIR}/src/theme - ${ADWAITAQT_INCLUDE_DIRS} ) set(MEDIAWRITER_SRCS @@ -17,8 +15,6 @@ set(MEDIAWRITER_SRCS units.cpp utilities.cpp versionchecker.cpp - # From theme - ${CMAKE_SOURCE_DIR}/src/theme/icon.cpp ) if (UNIX AND NOT APPLE) @@ -81,7 +77,6 @@ target_link_libraries(mediawriter if (UNIX AND NOT APPLE) target_link_libraries(mediawriter Qt6::DBus - ${ADWAITAQT_LIBRARIES} ) endif() diff --git a/src/app/main.cpp b/src/app/main.cpp index 5ea11304..6b7b0efa 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -31,16 +31,11 @@ #include "crashhandler.h" #include "drivemanager.h" -#include "icon.h" #include "portalfiledialog.h" #include "releasemanager.h" #include "units.h" #include "versionchecker.h" -#if (defined(__linux)) -#include -#endif - #ifdef QT_STATIC Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); @@ -74,10 +69,6 @@ int main(int argc, char **argv) QApplication::setOrganizationName("fedoraproject.org"); QApplication::setApplicationName("MediaWriter"); -#if (defined(__linux)) - QQuickStyle::setStyle("QtQuick.Controls.org.fedoraproject.AdwaitaTheme"); -#endif - QApplication app(argc, argv); options.parse(app.arguments()); @@ -87,10 +78,6 @@ int main(int argc, char **argv) if (translator.load(QLocale(QLocale().language(), QLocale().country()), QLatin1String(), QLatin1String(), ":/translations")) app.installTranslator(&translator); -#if (defined(__linux)) - QPalette adwaitaPalette = Adwaita::Colors::palette(); - QGuiApplication::setPalette(adwaitaPalette); -#endif QGuiApplication::setDesktopFileName("org.fedoraproject.MediaWriter.desktop"); mDebug() << "Injecting QML context properties"; @@ -109,8 +96,6 @@ int main(int argc, char **argv) engine.rootContext()->setContextProperty("platformSupportsDelayedWriting", false); #endif - qmlRegisterType("MediaWriter", 1, 0, "Icon"); - mDebug() << "Loading the QML source code"; engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); diff --git a/src/theme/CMakeLists.txt b/src/theme/CMakeLists.txt deleted file mode 100644 index 2acf32e5..00000000 --- a/src/theme/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ - -include_directories(${ADWAITAQT_INCLUDE_DIRS}) - -set(ADWAITA_THEME_PLUGIN_SRCS - adwaitathemeplugin.cpp - icon.cpp - theme.cpp -) - -add_library(adwaitathemeplugin SHARED ${ADWAITA_THEME_PLUGIN_SRCS}) - -target_link_libraries(adwaitathemeplugin - Qt6::Core - Qt6::Qml - Qt6::Quick - Qt6::QuickControls2 - Qt6::Widgets - ${ADWAITAQT_LIBRARIES} -) - -install(TARGETS adwaitathemeplugin DESTINATION ${QT6_INSTALL_QML}/org/fedoraproject/AdwaitaTheme) -install(FILES qmldir DESTINATION ${QT6_INSTALL_QML}/org/fedoraproject/AdwaitaTheme) -install(DIRECTORY qml/ DESTINATION ${QT6_INSTALL_QML}/QtQuick/Controls/org/fedoraproject/AdwaitaTheme) diff --git a/src/theme/adwaitathemeplugin.cpp b/src/theme/adwaitathemeplugin.cpp deleted file mode 100644 index 22a53988..00000000 --- a/src/theme/adwaitathemeplugin.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "adwaitathemeplugin.h" -#include "icon.h" -#include "theme.h" - -#include - -void AdwaitaThemePlugin::initializeEngine(QQmlEngine *engine, const char *uri) -{ - QQmlExtensionPlugin::initializeEngine(engine, uri); - - QQmlContext *context = engine->rootContext(); - - AdwaitaTheme *theme = new AdwaitaTheme(engine); - context->setContextProperty(QStringLiteral("theme"), theme); -} - -void AdwaitaThemePlugin::registerTypes(const char *uri) -{ - Q_ASSERT(uri == QByteArray("org.fedoraproject.AdwaitaTheme")); - - qmlRegisterUncreatableType(uri, 2, 0, "Theme", QStringLiteral("It is not possible to instantiate Theme directly.")); - qmlRegisterType(uri, 2, 0, "Icon"); -} diff --git a/src/theme/adwaitathemeplugin.h b/src/theme/adwaitathemeplugin.h deleted file mode 100644 index c086de83..00000000 --- a/src/theme/adwaitathemeplugin.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef ADWAITA_THEME_PLUGIN_H -#define ADWAITA_THEME_PLUGIN_H - -#include -#include - -class AdwaitaThemePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void initializeEngine(QQmlEngine *engine, const char *uri) override; - void registerTypes(const char *uri) override; -}; - -#endif // ADWAITA_THEME_PLUGIN_H diff --git a/src/theme/icon.cpp b/src/theme/icon.cpp deleted file mode 100644 index 2ffec695..00000000 --- a/src/theme/icon.cpp +++ /dev/null @@ -1,515 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2011 Marco Martin - * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#include "icon.h" -//#include "theme.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class ManagedTextureNode : public QSGSimpleTextureNode -{ - Q_DISABLE_COPY(ManagedTextureNode) -public: - ManagedTextureNode(); - - void setTexture(QSharedPointer texture); - -private: - QSharedPointer m_texture; -}; - -ManagedTextureNode::ManagedTextureNode() -{ -} - -void ManagedTextureNode::setTexture(QSharedPointer texture) -{ - m_texture = texture; - QSGSimpleTextureNode::setTexture(texture.data()); -} - -typedef QHash>> TexturesCache; - -struct ImageTexturesCachePrivate { - TexturesCache cache; -}; - -class ImageTexturesCache -{ -public: - ImageTexturesCache(); - ~ImageTexturesCache(); - - /** - * @returns the texture for a given @p window and @p image. - * - * If an @p image id is the same as one already provided before, we won't create - * a new texture and return a shared pointer to the existing texture. - */ - QSharedPointer loadTexture(QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options); - - QSharedPointer loadTexture(QQuickWindow *window, const QImage &image); - -private: - QScopedPointer d; -}; - -ImageTexturesCache::ImageTexturesCache() - : d(new ImageTexturesCachePrivate) -{ -} - -ImageTexturesCache::~ImageTexturesCache() -{ -} - -QSharedPointer ImageTexturesCache::loadTexture(QQuickWindow *window, const QImage &image, QQuickWindow::CreateTextureOptions options) -{ - qint64 id = image.cacheKey(); - QSharedPointer texture = d->cache.value(id).value(window).toStrongRef(); - - if (!texture) { - auto cleanAndDelete = [this, window, id](QSGTexture *texture) { - QHash> &textures = (d->cache)[id]; - textures.remove(window); - if (textures.isEmpty()) - d->cache.remove(id); - delete texture; - }; - texture = QSharedPointer(window->createTextureFromImage(image, options), cleanAndDelete); - (d->cache)[id][window] = texture.toWeakRef(); - } - - // if we have a cache in an atlas but our request cannot use an atlassed texture - // create a new texture and use that - // don't use removedFromAtlas() as that requires keeping a reference to the non atlased version - if (!(options & QQuickWindow::TextureCanUseAtlas) && texture->isAtlasTexture()) { - texture = QSharedPointer(window->createTextureFromImage(image, options)); - } - - return texture; -} - -QSharedPointer ImageTexturesCache::loadTexture(QQuickWindow *window, const QImage &image) -{ - return loadTexture(window, image, {}); -} - -Q_GLOBAL_STATIC(ImageTexturesCache, s_iconImageCache) - -Icon::Icon(QQuickItem *parent) - : QQuickItem(parent) - , m_smooth(false) - , m_changed(false) - , m_active(false) - , m_selected(false) - , m_isMask(false) -{ - setFlag(ItemHasContents, true); -} - -Icon::~Icon() -{ -} - -void Icon::setSource(const QVariant &icon) -{ - if (m_source == icon) { - return; - } - m_source = icon; - m_monochromeHeuristics.clear(); - - // if (!m_theme) { - // m_theme = new AdwaitaTheme(this); - // Q_ASSERT(m_theme); - - // connect(m_theme, &AdwaitaTheme::colorsChanged, this, &QQuickItem::polish); - // } - - if (icon.typeId() == QMetaType::QString) { - const QString iconSource = icon.toString(); - m_isMaskHeuristic = (iconSource.endsWith(QLatin1String("-symbolic")) || iconSource.endsWith(QLatin1String("-symbolic-rtl")) || iconSource.endsWith(QLatin1String("-symbolic-ltr"))); - emit isMaskChanged(); - } - - m_loadedImage = QImage(); - - polish(); - emit sourceChanged(); - emit validChanged(); -} - -QVariant Icon::source() const -{ - return m_source; -} - -void Icon::setActive(const bool active) -{ - if (active == m_active) { - return; - } - m_active = active; - polish(); - emit activeChanged(); -} - -bool Icon::active() const -{ - return m_active; -} - -bool Icon::valid() const -{ - return !m_source.isNull(); -} - -void Icon::setSelected(const bool selected) -{ - if (selected == m_selected) { - return; - } - m_selected = selected; - polish(); - emit selectedChanged(); -} - -bool Icon::selected() const -{ - return m_selected; -} - -void Icon::setIsMask(bool mask) -{ - if (m_isMask == mask) { - return; - } - - m_isMask = mask; - m_isMaskHeuristic = mask; - polish(); - emit isMaskChanged(); -} - -bool Icon::isMask() const -{ - return m_isMask || m_isMaskHeuristic; -} - -void Icon::setColor(const QColor &color) -{ - if (m_color == color) { - return; - } - - m_color = color; - polish(); - emit colorChanged(); -} - -QColor Icon::color() const -{ - return m_color; -} - -int Icon::implicitWidth() const -{ - return 32; -} - -int Icon::implicitHeight() const -{ - return 32; -} - -void Icon::setSmooth(const bool smooth) -{ - if (smooth == m_smooth) { - return; - } - m_smooth = smooth; - polish(); - emit smoothChanged(); -} - -bool Icon::smooth() const -{ - return m_smooth; -} - -QSGNode *Icon::updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData * /*data*/) -{ - if (m_source.isNull() || qFuzzyIsNull(width()) || qFuzzyIsNull(height())) { - delete node; - return Q_NULLPTR; - } - - if (m_changed || node == nullptr) { - const QSize itemSize(width(), height()); - QRect nodeRect(QPoint(0, 0), itemSize); - - ManagedTextureNode *mNode = dynamic_cast(node); - if (!mNode) { - delete node; - mNode = new ManagedTextureNode; - } - if (itemSize.width() != 0 && itemSize.height() != 0) { - mNode->setTexture(s_iconImageCache->loadTexture(window(), m_icon)); - if (m_icon.size() != itemSize) { - // At this point, the image will already be scaled, but we need to output it in - // the correct aspect ratio, painted centered in the viewport. So: - QRect destination(QPoint(0, 0), m_icon.size().scaled(itemSize, Qt::KeepAspectRatio)); - destination.moveCenter(nodeRect.center()); - nodeRect = destination; - } - } - mNode->setRect(nodeRect); - node = mNode; - if (m_smooth) { - mNode->setFiltering(QSGTexture::Linear); - } - m_changed = false; - } - - return node; -} - -void Icon::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - QQuickItem::geometryChange(newGeometry, oldGeometry); - if (newGeometry.size() != oldGeometry.size()) { - polish(); - } -} - -void Icon::updatePolish() -{ - QQuickItem::updatePolish(); - - if (m_source.isNull()) { - return; - } - - const QSize itemSize(width(), height()); - if (itemSize.width() != 0 && itemSize.height() != 0) { - switch (m_source.typeId()) { - case QMetaType::QPixmap: - m_icon = m_source.value().toImage(); - break; - case QMetaType::QImage: - m_icon = m_source.value(); - break; - case QMetaType::QBitmap: - m_icon = m_source.value().toImage(); - break; - case QMetaType::QIcon: - QScreen *screen; - m_icon = m_source.value().pixmap(itemSize, screen->devicePixelRatio()).toImage(); - break; - case QMetaType::QUrl: - case QMetaType::QString: - m_icon = findIcon(itemSize); - break; - case QMetaType::QBrush: - // todo: fill here too? - case QMetaType::QColor: - m_icon = QImage(itemSize, QImage::Format_Alpha8); - m_icon.fill(m_source.value()); - break; - default: - break; - } - - if (m_icon.isNull()) { - m_icon = QImage(itemSize, QImage::Format_Alpha8); - m_icon.fill(Qt::transparent); - } - - // const QColor tintColor = !m_color.isValid() || m_color == Qt::transparent ? (m_selected ? m_theme->highlightTextColor() : m_theme->textColor()) : m_color; - const QPalette &palette = QGuiApplication::palette(); - const QColor tintColor = !m_color.isValid() || m_color == Qt::transparent ? (m_selected ? palette.color(QPalette::HighlightedText) : palette.color(QPalette::Text)) : m_color; - - // TODO: initialize m_isMask with icon.isMask() - if (tintColor.alpha() > 0 && (isMask() || guessMonochrome(m_icon))) { - QPainter p(&m_icon); - p.setCompositionMode(QPainter::CompositionMode_SourceIn); - p.fillRect(m_icon.rect(), tintColor); - p.end(); - } - } - m_changed = true; - update(); -} - -QImage Icon::findIcon(const QSize &size) -{ - QImage img; - QString iconSource = m_source.toString(); - - if (iconSource.startsWith(QLatin1String("image://"))) { - QUrl iconUrl(iconSource); - QString iconProviderId = iconUrl.host(); - QString iconId = iconUrl.path(); - - // QRC paths are not correctly handled by .path() - if (iconId.size() >= 2 && iconId.startsWith(QLatin1String("/:"))) { - iconId.remove(0, 1); - } - - QSize actualSize; - QQuickImageProvider *imageProvider = dynamic_cast(qmlEngine(this)->imageProvider(iconProviderId)); - if (!imageProvider) - return img; - switch (imageProvider->imageType()) { - case QQmlImageProviderBase::Image: - img = imageProvider->requestImage(iconId, &actualSize, size); - break; - case QQmlImageProviderBase::Pixmap: - img = imageProvider->requestPixmap(iconId, &actualSize, size).toImage(); - break; - case QQmlImageProviderBase::Texture: - case QQmlImageProviderBase::Invalid: - case QQmlImageProviderBase::ImageResponse: - // will have to investigate this more - break; - } - } else { - if (iconSource.startsWith(QLatin1String("qrc:/"))) { - iconSource = iconSource.mid(3); - } else if (iconSource.startsWith(QLatin1String("file:/"))) { - iconSource = QUrl(iconSource).path(); - } - - QIcon icon; - const bool isPath = iconSource.contains(QLatin1String("/")); - if (isPath) { - icon = QIcon(iconSource); - } else { - if (icon.isNull()) { - icon = QIcon::fromTheme(iconSource); - } - } - if (!icon.isNull()) { - QScreen *screen; - img = icon.pixmap(size, screen->devicePixelRatio()).toImage(); - - /*const QColor tintColor = !m_color.isValid() || m_color == Qt::transparent ? (m_selected ? m_theme->highlightedTextColor() : m_theme->textColor()) : m_color; - - if (m_isMask || icon.isMask() || iconSource.endsWith(QLatin1String("-symbolic")) || iconSource.endsWith(QLatin1String("-symbolic-rtl")) || iconSource.endsWith(QLatin1String("-symbolic-ltr")) || guessMonochrome(img)) { - QPainter p(&img); - p.setCompositionMode(QPainter::CompositionMode_SourceIn); - p.fillRect(img.rect(), tintColor); - p.end(); - }*/ - } - } - - if (!iconSource.isEmpty() && img.isNull()) { - QScreen *screen; - img = QIcon::fromTheme(m_fallback).pixmap(size, screen->devicePixelRatio()).toImage(); - } - return img; -} - -QIcon::Mode Icon::iconMode() const -{ - if (!isEnabled()) { - return QIcon::Disabled; - } else if (m_selected) { - return QIcon::Selected; - } else if (m_active) { - return QIcon::Active; - } - return QIcon::Normal; -} - -bool Icon::guessMonochrome(const QImage &img) -{ - // don't try for too big images - if (img.width() >= 256) { - return false; - } - // round size to a standard size. hardcode as we can't use KIconLoader - int stdSize; - if (img.width() <= 16) { - stdSize = 16; - } else if (img.width() <= 22) { - stdSize = 22; - } else if (img.width() <= 24) { - stdSize = 24; - } else if (img.width() <= 32) { - stdSize = 32; - } else if (img.width() <= 48) { - stdSize = 48; - } else if (img.width() <= 64) { - stdSize = 64; - } else { - stdSize = 128; - } - - auto findIt = m_monochromeHeuristics.constFind(stdSize); - if (findIt != m_monochromeHeuristics.constEnd()) { - return findIt.value(); - } - - QHash dist; - int transparentPixels = 0; - int saturatedPixels = 0; - for (int x = 0; x < img.width(); x++) { - for (int y = 0; y < img.height(); y++) { - QColor color = QColor::fromRgba(qUnpremultiply(img.pixel(x, y))); - if (color.alpha() < 100) { - ++transparentPixels; - continue; - } else if (color.saturation() > 84) { - ++saturatedPixels; - } - dist[qGray(color.rgb())]++; - } - } - - QMultiMap reverseDist; - auto it = dist.constBegin(); - qreal entropy = 0; - while (it != dist.constEnd()) { - reverseDist.insert(it.value(), it.key()); - qreal probability = qreal(it.value()) / qreal(img.size().width() * img.size().height() - transparentPixels); - entropy -= probability * log(probability) / log(255); - ++it; - } - - // Arbitrarly low values of entropy and colored pixels - m_monochromeHeuristics[stdSize] = saturatedPixels <= (img.size().width() * img.size().height() - transparentPixels) * 0.3 && entropy <= 0.3; - return m_monochromeHeuristics[stdSize]; -} - -QString Icon::fallback() const -{ - return m_fallback; -} - -void Icon::setFallback(const QString &fallback) -{ - if (m_fallback != fallback) { - m_fallback = fallback; - Q_EMIT fallbackChanged(fallback); - } -} diff --git a/src/theme/icon.h b/src/theme/icon.h deleted file mode 100644 index a825810b..00000000 --- a/src/theme/icon.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2011 Marco Martin - * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez - * SPDX-FileCopyrightText: 2020 Carson Black - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#pragma once - -#include -#include -#include -#include - -class AdwaitaTheme; - -/** - * Class for rendering an icon in UI. - */ -class Icon : public QQuickItem -{ - Q_OBJECT - - /** - * The source of this icon. An `Icon` can pull from: - * - * * The icon theme: - * @include icon/IconThemeSource.qml - * * The filesystem: - * @include icon/FilesystemSource.qml - * * Remote URIs: - * @include icon/InternetSource.qml - * * Custom providers: - * @include icon/CustomSource.qml - * * Your application's bundled resources: - * @include icon/ResourceSource.qml - * - * @note See https://doc.qt.io/qt-5/qtquickcontrols2-icons.html for how to - * bundle icon themes in your application to refer to them by name instead of - * by resource URL. - * - * @note Use `fallback` to provide a fallback theme name for icons. - */ - Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged) - - /** - * The name of a fallback icon to load from the icon theme when the `source` - * cannot be found. The default fallback icon is `"unknown"`. - * - * @include icon/Fallback.qml - * - * @note This will only be loaded if source is unavailable (e.g. it doesn't exist, or network issues have prevented loading). - */ - Q_PROPERTY(QString fallback READ fallback WRITE setFallback NOTIFY fallbackChanged) - - /** - * Whether pixmaps will be scaled smoothly if the size of this `Icon` is - * different from the source size. - */ - Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged) - - /** - * The `implicitWidth` of this item, derived from the `source` image. - */ - Q_PROPERTY(int implicitWidth READ implicitWidth CONSTANT) - - /** - * The `implicitHeight` of this item, derived from the `source` image. - */ - Q_PROPERTY(int implicitHeight READ implicitHeight CONSTANT) - - /** - * Whether this icon will use the QIcon::Active mode when drawing the icon, - * resulting in a graphical effect being applied to the icon to indicate that - * it is currently active. - * - * This is typically used to indicate when an item is being hovered or pressed. - * - * @image html icon/active.png - * - * The color differences under the default KDE color palette, Breeze. Note - * that a dull highlight background is typically displayed behind active icons and - * it is recommended to add one if you are creating a custom component. - */ - Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged) - - /** - * Whether this icon's `source` is valid and it is being used. - */ - Q_PROPERTY(bool valid READ valid NOTIFY validChanged) - - /** - * Whether this icon will use the QIcon::Selected mode when drawing the icon, - * resulting in a graphical effect being applied to the icon to indicate that - * it is currently selected. - * - * This is typically used to indicate when a list item is currently selected. - * - * @image html icon/selected.png - * - * The color differences under the default KDE color palette, Breeze. Note - * that a blue background is typically displayed behind selected elements. - */ - Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged) - - /** - * Whether this icon will be treated as a mask. When an icon is being used - * as a mask, all non-transparent colors are replaced with the color provided in the Icon's - * @link Icon::color color @endlink property. - * - * @see color - */ - Q_PROPERTY(bool isMask READ isMask WRITE setIsMask NOTIFY isMaskChanged) - - /** - * The color to use when drawing this icon when `isMask` is enabled. - * If this property is not set or is `Qt::transparent`, the icon will use - * the text or the selected text color, depending on if `selected` is set to - * true. - */ - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) - -public: - Icon(QQuickItem *parent = nullptr); - ~Icon(); - - void setSource(const QVariant &source); - QVariant source() const; - - int implicitWidth() const; - int implicitHeight() const; - - void setSmooth(const bool smooth); - bool smooth() const; - - void setActive(bool active = true); - bool active() const; - - bool valid() const; - - void setSelected(bool selected = true); - bool selected() const; - - void setIsMask(bool mask); - bool isMask() const; - - void setColor(const QColor &color); - QColor color() const; - - QString fallback() const; - void setFallback(const QString &fallback); - - QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *data) override; - -Q_SIGNALS: - void sourceChanged(); - void smoothChanged(); - void enabledChanged(); - void activeChanged(); - void validChanged(); - void selectedChanged(); - void isMaskChanged(); - void colorChanged(); - void fallbackChanged(const QString &fallback); - -protected: - void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; - QImage findIcon(const QSize &size); - QIcon::Mode iconMode() const; - bool guessMonochrome(const QImage &img); - void updatePolish() override; - -private: - AdwaitaTheme *m_theme = nullptr; - QHash m_monochromeHeuristics; - QVariant m_source; - bool m_smooth; - bool m_changed; - bool m_active; - bool m_selected; - bool m_isMask; - bool m_isMaskHeuristic = false; - QImage m_loadedImage; - QColor m_color = Qt::transparent; - QString m_fallback = QStringLiteral("unknown"); - - QImage m_icon; -}; diff --git a/src/theme/qml/Button.qml b/src/theme/qml/Button.qml deleted file mode 100644 index 9650df59..00000000 --- a/src/theme/qml/Button.qml +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Templates as T -import QtQuick.Layouts -import org.fedoraproject.AdwaitaTheme -import "private" as Private - -T.Button { - id: control - - property bool destructiveAction: false - - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding - implicitHeight: contentItem.implicitHeight + bottomPadding + topPadding - - leftPadding: theme.buttonMarginWidth - rightPadding: theme.buttonMarginWidth - bottomPadding: theme.buttonMarginWidth - topPadding: theme.buttonMarginWidth - - Layout.minimumWidth: control.text ? theme.buttonMinimumWidth : theme.buttonMinimumWidth / 2 - - hoverEnabled: true - - contentItem: RowLayout { - Icon { - id: icon - - Layout.alignment: Qt.AlignCenter - - Layout.fillWidth: true - Layout.fillHeight: true - - Layout.minimumWidth: Math.min(parent.width, parent.height, implicitWidth) - Layout.minimumHeight: Math.min(parent.width, parent.height, implicitHeight) - - Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY - Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY - - visible: source.length > 0 && control.display !== T.Button.TextOnly - source: control.icon ? (control.icon.name || control.icon.source) : "" - } - - Label { - id: label - Layout.leftMargin: theme.buttonItemSpacing - Layout.rightMargin: theme.buttonItemSpacing - Layout.fillWidth: true - text: control.text - font: control.font - color: control.enabled ? control.highlighted ? theme.highlightTextColor : theme.textColor : theme.disabledTextColor - horizontalAlignment: icon.visible ? Text.AlignLeft : Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - visible: control.text - } - } - - background: Private.ButtonFrame { - anchors.fill: parent - flat: control.flat - highlighted: control.highlighted - destructiveAction: control.destructiveAction - } -} - diff --git a/src/theme/qml/CheckBox.qml b/src/theme/qml/CheckBox.qml deleted file mode 100644 index 2397e230..00000000 --- a/src/theme/qml/CheckBox.qml +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme - -T.CheckBox { - id: control - - // FIXME: windows seems to need more space for some reason - implicitWidth: implicitContentWidth + leftPadding + rightPadding + (Qt.platform.os == "windows" ? indicator.width : spacing) - implicitHeight: implicitContentHeight + bottomPadding + topPadding - - padding: theme.checkboxItemSpacing - spacing: theme.checkboxItemSpacing - hoverEnabled: true - - indicator: CheckIndicator { - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - control: control - } - - contentItem: Text { - id: label - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - text: control.text - font: control.font - color: control.enabled ? theme.textColor : theme.disabledTextColor - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - visible: control.text - } -} diff --git a/src/theme/qml/CheckIndicator.qml b/src/theme/qml/CheckIndicator.qml deleted file mode 100644 index 8a2b4b93..00000000 --- a/src/theme/qml/CheckIndicator.qml +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import org.fedoraproject.AdwaitaTheme - -Rectangle { - id: root - - property Item control - - width: theme.checkboxSize - 4 - height: theme.checkboxSize - 4 - - radius: Math.max(theme.frameRadius - 1, 0) - - readonly property int animationDuration: 150 - - gradient: Gradient { - GradientStop { - position: 0.0 - color: root.topColor - } - GradientStop { - position: 1.0 - color: root.bottomColor - } - } - - property color bottomColor: { - return theme.getCheckBoxBottomColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - property color topColor: { - return theme.getCheckBoxTopColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - border { - color: theme.getCheckBoxOutlineColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - Item { - visible: (typeof control.checkState !== "undefined") && control.checkState == Qt.Checked - opacity: visible - rotation: -45 - anchors.fill: parent - Rectangle { - color: theme.highlightTextColor - x: 5 - y: 4 - width: 3 - height: 6 - radius: 4 - } - Rectangle { - color: theme.highlightTextColor - x: 5 - y: 8 - width: 10 - height: 3 - radius: 7 - } - - Behavior on opacity { PropertyAnimation { duration: root.animationDuration } } - } -} diff --git a/src/theme/qml/ComboBox.qml b/src/theme/qml/ComboBox.qml deleted file mode 100644 index 6098de95..00000000 --- a/src/theme/qml/ComboBox.qml +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Shapes -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme -import "private" as Private - -T.ComboBox { - id: control - - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) + spacing + indicator.implicitWidth + rightPadding - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + bottomPadding + topPadding) - - spacing: theme.menuItemSpacing - leftPadding: theme.comboBoxMarginWidth - rightPadding: theme.comboBoxMarginWidth - bottomPadding: theme.comboBoxMarginHeight - topPadding: theme.comboBoxMarginHeight - - hoverEnabled: true - - delegate: MenuItem { - width: parent.width - theme.frameWidth - text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData - font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal - highlighted: control.highlightedIndex == index - hoverEnabled: control.hoverEnabled - x: theme.frameWidth / 2 - } - - indicator: Shape { - implicitHeight: 10 - implicitWidth: 10 - x: control.mirrored ? control.leftPadding - 2 : control.width - width - control.rightPadding + 2 - y: control.topPadding + control.availableHeight / 2 - - ShapePath { - fillColor: theme.textColor - strokeColor: theme.textColor - capStyle: ShapePath.FlatCap - joinStyle: ShapePath.MiterJoin - - startX: -4 - startY: -2 - PathLine { x: 0; y: 2 } - PathLine { x: 4; y: -2 } - } - } - - contentItem: T.TextField { - anchors { - fill: parent - leftMargin: control.leftPadding - rightMargin: control.rightPadding + indicator.width + control.spacing - bottomMargin: control.bottomPadding - topMargin: control.topPadding - } - implicitWidth: contentWidth - text: control.editable ? control.editText : control.displayText - - enabled: control.editable - autoScroll: control.editable - readOnly: control.down - inputMethodHints: control.inputMethodHints - validator: control.validator - - font: control.font - color: control.enabled ? theme.textColor : theme.disabledTextColor - selectionColor: theme.highlightColor - selectedTextColor: theme.highlightTextColor - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { - id: rect - anchors.fill: parent - implicitHeight: theme.comboBoxMinimumHeight - implicitWidth: theme.comboBoxMinimumWidth - radius: theme.frameRadius - visible: control.flat ? control.pressed || control.checked : true - - readonly property int animationDuration: 150 - - gradient: Gradient { - GradientStop { - position: 0.0 - color: control.editable ? control.enabled ? theme.baseColor : theme.windowColor : rect.topColor - Behavior on color { ColorAnimation { duration: rect.animationDuration } } - } - GradientStop { - position: 1.0 - color: control.editable ? control.enabled ? theme.baseColor :theme.windowColor : rect.bottomColor - Behavior on color { ColorAnimation { duration: rect.animationDuration } } - } - } - - property color bottomColor: { - return theme.getButtonBottomColor(false, false, control.hovered, control.pressed || control.checked) - } - - property color topColor: { - return theme.getButtonTopColor(false, false, control.hovered, control.pressed || control.checked) - } - - border { - color: control.editable ? control.focus ? theme.highlightColor : theme.getButtonOutlineColor(false, false, control.hovered, false) : - theme.getButtonOutlineColor(false, false, control.hovered, control.pressed || control.checked) - } - } - - popup: T.Popup { - x: control.mirrored ? control.width - width : 0 - y: control.height - width: control.width - height: contentItem.implicitHeight + (theme.menuItemSpacing * 2) - topMargin: 6 - bottomMargin: 6 - - contentItem: ListView { - id: listView - clip: true - implicitHeight: contentHeight - model: control.popup.visible ? control.delegateModel : null - currentIndex: control.highlightedIndex - highlightRangeMode: ListView.ApplyRange - highlightMoveDuration: 0 - topMargin: theme.menuItemSpacing - T.ScrollBar.vertical: ScrollBar { } - } - - background: Rectangle { - anchors { - fill: parent - margins: 1 - } - color: theme.baseColor - border.color: theme.getButtonOutlineColor(false, false, false, false) - radius: theme.frameRadius - } - } -} diff --git a/src/theme/qml/Label.qml b/src/theme/qml/Label.qml deleted file mode 100644 index 974bcad2..00000000 --- a/src/theme/qml/Label.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme -import "private" as Private - - -T.Label { - id: control - - verticalAlignment: Text.AlignVCenter - - color: theme.textColor - linkColor: theme.linkColor - - Accessible.role: Accessible.StaticText - Accessible.name: text -} - - diff --git a/src/theme/qml/MenuItem.qml b/src/theme/qml/MenuItem.qml deleted file mode 100644 index 267c0d42..00000000 --- a/src/theme/qml/MenuItem.qml +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Shapes -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme -import "private" as Private - -T.MenuItem { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentItem.implicitWidth + leftPadding + rightPadding + spacing + (arrow ? arrow.implicitWidth : 0)) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight+ topPadding + bottomPadding, - indicator ? indicator.implicitHeight : 0) - - bottomPadding: theme.menuItemMarginWidth - topPadding: theme.menuItemMarginWidth - leftPadding: theme.menuItemMarginWidth - rightPadding: theme.menuItemMarginWidth - - spacing: theme.menuItemSpacing - - icon.width: 16 - icon.height: 16 - - contentItem: RowLayout { - Icon { - id: icon - - Layout.alignment: Qt.AlignCenter - - Layout.fillWidth: true - Layout.fillHeight: true - - Layout.minimumWidth: Math.min(parent.width, parent.height, implicitWidth) - Layout.minimumHeight: Math.min(parent.width, parent.height, implicitHeight) - - Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY - Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY - - visible: source.length > 0 - source: control.icon ? (control.icon.name || control.icon.source) : "" - } - - Label { - id: label - Layout.leftMargin: control.leftPadding - Layout.fillWidth: true - text: control.text - font: control.font - color: control.highlighted ? theme.highlightTextColor : control.enabled ? theme.textColor : theme.disabledTextColor - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - visible: control.text - } - } - - arrow: Shape { - implicitHeight: 10 - implicitWidth: 10 - x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + control.availableHeight / 2 - visible: control.subMenu - - ShapePath { - fillColor: theme.textColor - strokeColor: theme.textColor - capStyle: ShapePath.FlatCap - joinStyle: ShapePath.MiterJoin - - startX: -2 - startY: -4 - PathLine { x: 2; y: 0 } - PathLine { x: -2; y: 4 } - } - } - - indicator: CheckIndicator { - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - control: control - visible: control.checkable - } - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 20 - - color: theme.highlightColor - visible: control.down || control.highlighted - } -} diff --git a/src/theme/qml/ProgressBar.qml b/src/theme/qml/ProgressBar.qml deleted file mode 100644 index d5b05a8a..00000000 --- a/src/theme/qml/ProgressBar.qml +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme - -T.ProgressBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - property color progressBarColor: theme.highlightColor - - contentItem: Item { - scale: control.mirrored ? -1 : 1 - - Rectangle { - id: indicator - height: parent.height - width: control.indeterminate ? theme.progressBarBusyIndicatorSize : parent.width * control.position - color: control.progressBarColor - border.color: theme.getProgressBarOutlineColor() - } - - SequentialAnimation { - id: animation - loops: Animation.Infinite - - alwaysRunToEnd: true - running: control.indeterminate && control.visible - - PropertyAnimation { - target: indicator - property: "x" - duration: 2500 - from: 1 - to: control.width - indicator.width - } - PropertyAnimation { - target: indicator - property: "x" - duration: 2500 - to: 1 - } - } - } - - background: Rectangle { - implicitWidth: 100 - implicitHeight: theme.progressBarThickness + 0.5 - color: theme.getProgressBarColor() - border.color: theme.getProgressBarOutlineColor() - radius: 0.5 - } - -} diff --git a/src/theme/qml/RadioButton.qml b/src/theme/qml/RadioButton.qml deleted file mode 100644 index bda878a1..00000000 --- a/src/theme/qml/RadioButton.qml +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme - -T.RadioButton { - id: control - - // FIXME: windows seems to need more space for some reason - implicitWidth: implicitContentWidth + leftPadding + rightPadding + (Qt.platform.os == "windows" ? indicator.width : spacing) - implicitHeight: implicitContentHeight + bottomPadding + topPadding - - padding: theme.checkboxItemSpacing - spacing: theme.checkboxItemSpacing - hoverEnabled: true - - indicator: RadioIndicator { - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - control: control - } - - contentItem: Text { - id: label - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - text: control.text - font: control.font - color: control.enabled ? theme.textColor : theme.disabledTextColor - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - visible: control.text - } -} diff --git a/src/theme/qml/RadioIndicator.qml b/src/theme/qml/RadioIndicator.qml deleted file mode 100644 index dd2190d8..00000000 --- a/src/theme/qml/RadioIndicator.qml +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import org.fedoraproject.AdwaitaTheme - -Rectangle { - id: root - - property Item control - - width: theme.checkboxSize - 4 - height: theme.checkboxSize - 4 - - radius: width / 2 - - readonly property int animationDuration: 150 - - gradient: Gradient { - GradientStop { - position: 0.0 - color: root.topColor - } - GradientStop { - position: 1.0 - color: root.bottomColor - } - } - - property color bottomColor: { - return theme.getCheckBoxBottomColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - property color topColor: { - return theme.getCheckBoxTopColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - border { - color: theme.getCheckBoxOutlineColor(control.hovered, control.down, control.checked || ((typeof control.checkState !== "undefined") && control.checkState == Qt.Checked)) - } - - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - visible: control.checked - opacity: visible - color: theme.highlightTextColor - width: parent.width / 2 - height: parent.width / 2 - radius: width / 2 - - Behavior on opacity { PropertyAnimation { duration: root.animationDuration } } - } -} diff --git a/src/theme/qml/ScrollBar.qml b/src/theme/qml/ScrollBar.qml deleted file mode 100644 index c308c308..00000000 --- a/src/theme/qml/ScrollBar.qml +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme -import "private" as Private - -T.ScrollBar { - id: control - - implicitWidth: implicitContentWidth + leftPadding + rightPadding - implicitHeight: implicitContentHeight + topPadding + bottomPadding - - leftPadding: 4 - rightPadding: 4 - bottomPadding: 4 - topPadding: 4 - // FIXME - // Workaround for me not being able to hide horizontal scrollbar - visible: control.size < 1.0 && orientation !== Qt.Horizontal - minimumSize: orientation == Qt.Horizontal ? height / width : width / height - hoverEnabled: true - - contentItem: Rectangle { - implicitWidth: control.pressed || control.hovered ? 6 : 2 - implicitHeight: control.pressed || control.hovered ? 6 : 2 - radius: width / 2 - color: theme.getScrollBarHandleColor(control.hovered, control.pressed) - } - - background: Item { - visible: control.size < 1.0 && (control.pressed || control.hovered) - implicitWidth: implicitWidth - implicitHeight: implicitWidth - Rectangle { - anchors { - top: parent.top - bottom: parent.bottom - left: parent.left - } - width: parent.width - color: theme.getScrollBarGrooveColor() - border.color: Qt.darker(palette.window, 1.2) // FIXME - border.width: 1 - } - } -} diff --git a/src/theme/qml/TextField.qml b/src/theme/qml/TextField.qml deleted file mode 100644 index bf75b2c0..00000000 --- a/src/theme/qml/TextField.qml +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Layouts -import QtQuick.Templates as T -import org.fedoraproject.AdwaitaTheme -import "private" as Private - -T.TextField { - id: control - - implicitWidth: implicitBackgroundWidth + leftInset + rightInset - || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - leftPadding: theme.lineEditMarginWidth - rightPadding: theme.lineEditMarginWidth - bottomPadding: theme.lineEditMarginHeight - topPadding: theme.lineEditMarginHeight - - color: theme.textColor - selectionColor: theme.highlightColor - selectedTextColor: theme.highlightTextColor - placeholderTextColor: Qt.hsla(control.color.hslHue, control.color.hslSaturation, control.color.hslLightness, 0.6) - verticalAlignment: TextInput.AlignVCenter - - Label { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - background: Item { - implicitWidth: theme.lineEditMinimumWidth - implicitHeight: theme.lineEditMinimumHeight - - Rectangle { - anchors.fill: parent - anchors.margins: 1 - border.color: control.focus ? theme.highlightColor : theme.getButtonOutlineColor(false, false, control.hovered, false) - color: control.enabled ? theme.baseColor :theme.windowColor - radius: theme.frameRadius - } - } -} diff --git a/src/theme/qml/private/ButtonFrame.qml b/src/theme/qml/private/ButtonFrame.qml deleted file mode 100644 index b055acef..00000000 --- a/src/theme/qml/private/ButtonFrame.qml +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2016 Martin Bříza - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick -import org.fedoraproject.AdwaitaTheme - -Item { - id: root - - // TODO add a focus rect - - property bool flat: false - property bool highlighted: false - property bool destructiveAction: false - - Rectangle { - id: rect - anchors.fill: parent - radius: theme.frameRadius - visible: flat ? control.pressed || control.checked : true - - readonly property int animationDuration: 150 - - gradient: Gradient { - GradientStop { - position: 0.0 - color: rect.topColor - Behavior on color { ColorAnimation { duration: rect.animationDuration } } - } - GradientStop { - position: 1.0 - color: rect.bottomColor - Behavior on color { ColorAnimation { duration: rect.animationDuration } } - } - } - - property color bottomColor: { - return theme.getButtonBottomColor(root.highlighted, root.destructiveAction, control.hovered, control.pressed || control.checked) - } - - property color topColor: { - return theme.getButtonTopColor(root.highlighted, root.destructiveAction, control.hovered, control.pressed || control.checked) - } - - border { - color: theme.getButtonOutlineColor(root.highlighted, root.destructiveAction, control.hovered, control.pressed || control.checked) - } - } -} diff --git a/src/theme/qml/qmldir b/src/theme/qml/qmldir deleted file mode 100644 index 6310a061..00000000 --- a/src/theme/qml/qmldir +++ /dev/null @@ -1,27 +0,0 @@ -module org.fedoraproject.AdwaitaTheme -Button 2.0 Button.qml -Button 6.0 Button.qml -CheckBox 2.0 CheckBox.qml -CheckBox 6.0 CheckBox.qml -CheckIndicator 2.0 CheckIndicator.qml -CheckIndicator 6.0 CheckIndicator.qml -ComboBox 2.0 ComboBox.qml -ComboBox 6.0 ComboBox.qml -Label 2.0 Label.qml -Label 6.0 Label.qml -MenuItem 2.0 MenuItem.qml -MenuItem 6.0 MenuItem.qml -ProgressBar 2.0 ProgressBar.qml -ProgressBar 6.0 ProgressBar.qml -RadioButton 2.0 RadioButton.qml -RadioButton 6.0 RadioButton.qml -RadioIndicator 2.0 RadioIndicator.qml -RadioIndicator 6.0 RadioIndicator.qml -ScrollBar 2.0 ScrollBar.qml -ScrollBar 6.0 ScrollBar.qml -TextField 2.0 TextField.qml -TextField 6.0 TextField.qml - - - - diff --git a/src/theme/qmldir b/src/theme/qmldir deleted file mode 100644 index f223dbf8..00000000 --- a/src/theme/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -module org.fedoraproject.AdwaitaTheme -plugin adwaitathemeplugin diff --git a/src/theme/theme.cpp b/src/theme/theme.cpp deleted file mode 100644 index 3d3a9512..00000000 --- a/src/theme/theme.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "theme.h" - -#include -#include - -AdwaitaTheme::AdwaitaTheme(QObject *parent) - : QObject(parent) - , m_darkMode(false) -{ - // Just guess dark mode for now based on text color - const QColor textColor = QGuiApplication::palette().color(QPalette::Text); - if (qSqrt(((textColor.red() * textColor.red()) * 0.299) + ((textColor.green() * textColor.green()) * 0.587) + ((textColor.blue() * textColor.blue()) * 0.114)) > 128) { - m_darkMode = true; - } - - m_palette = Adwaita::Colors::palette(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); -} - -AdwaitaTheme *AdwaitaTheme::qmlAttachedProperties(QObject *object) -{ - return new AdwaitaTheme(object); -} - -QColor AdwaitaTheme::buttonOutlineColor() const -{ - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - return Adwaita::Colors::buttonOutlineColor(Adwaita::StyleOptions(m_palette)); -} - -QColor AdwaitaTheme::getButtonBottomColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed) -{ - // Give destructive action higher priority and leave "highlighted" as fallback - if (destructiveAction) { - if (pressed) { - return m_darkMode ? QColor("#8a1116") : QColor("#a0131a"); - } else if (hovered) { - // FIXME: this is not 1:1 from Adwaita, but we need to make it - // lighter to highlight the hover - return m_darkMode ? Adwaita::Colors::lighten(QColor("#ae151c"), 0.01) : QColor("#e01b24"); - } else { - return m_darkMode ? QColor("#ae151c") : QColor("#ce1921"); - } - } - - if (highlighted) { - if (pressed) { - return m_darkMode ? QColor("#103e75") : QColor("#1961b9"); - } else if (hovered) { - return m_darkMode ? QColor("#155099") : QColor("#3584e4"); - } else { - return m_darkMode ? QColor("#155099") : QColor("#2379e2"); - } - } - - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setMouseOver(hovered); - styleOptions.setSunken(pressed); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - const QColor color = Adwaita::Colors::buttonBackgroundColor(styleOptions); - - // FIXME - return hovered && m_darkMode ? Adwaita::Colors::lighten(color, 0.01) : color; -} - -QColor AdwaitaTheme::getButtonTopColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed) -{ - if (destructiveAction) { - if (pressed) { - return m_darkMode ? QColor("#8a1116") : QColor("#a0131a"); - } else if (hovered) { - // FIXME: this is not 1:1 from Adwaita, but we need to make it - // lighter to highlight the hover - return m_darkMode ? Adwaita::Colors::lighten(QColor("#b2161d"), 0.01) : QColor("#e41c26"); - } else { - return m_darkMode ? QColor("#b2161d") : QColor("#e01b24"); - } - } - - if (highlighted) { - if (pressed) { - return m_darkMode ? QColor("#103e75") : QColor("#1961b9"); - } else if (hovered) { - return m_darkMode ? QColor("#1655a2") : QColor("#3987e5"); - } else { - return m_darkMode ? QColor("#15539e") : QColor("#3483e4"); - } - } - - const QColor color = getButtonBottomColor(highlighted, destructiveAction, hovered, pressed); - - // TODO: separate this from Adwaita::Helper::renderButtonFrame() - if (pressed) { - // Pressed button in normal and dark mode is not a gradient, but just an image consting from same $color - return color; - } else if (hovered) { - return m_darkMode ? Adwaita::Colors::lighten(color, 0.02) : Adwaita::Colors::lighten(color, 0.01); - } else { - return m_darkMode ? Adwaita::Colors::lighten(color, 0.01) : Adwaita::Colors::lighten(color, 0.04); - } -} - -QColor AdwaitaTheme::getButtonOutlineColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed) -{ - if (destructiveAction) { - return m_darkMode ? QColor("#851015") : QColor("#b2161d"); - } - - if (highlighted) { - return m_darkMode ? QColor("#0f3b71") : QColor("#1b6acb"); - } - - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setMouseOver(hovered); - styleOptions.setSunken(pressed); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - return Adwaita::Colors::buttonOutlineColor(styleOptions); -} - -QColor AdwaitaTheme::getCheckBoxBottomColor(bool hovered, bool pressed, bool checked) -{ - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setMouseOver(hovered); - styleOptions.setSunken(pressed); - styleOptions.setCheckboxState(checked ? Adwaita::CheckBoxState::CheckOn : Adwaita::CheckBoxState::CheckOff); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - const QColor color = Adwaita::Colors::indicatorBackgroundColor(styleOptions); - - // TODO: separate this from Adwaita::Helper::renderCheckBoxFrame() - if (!checked) { - if (pressed) { - // Pressed button in normal and dark mode is not a gradient, but just an image consting from same $color - return color; - } else if (hovered) { - QColor baseColor = m_darkMode ? color : Adwaita::Colors::darken(color, 0.09); - return m_darkMode ? Adwaita::Colors::darken(baseColor, 0.04) : color; - } else { - QColor baseColor = m_darkMode ? Adwaita::Colors::lighten(color, 0.03) : Adwaita::Colors::darken(color, 0.05); - return m_darkMode ? Adwaita::Colors::darken(baseColor, 0.06) : baseColor; - } - } else { - return Adwaita::Colors::lighten(color, 0.04); - } -} - -QColor AdwaitaTheme::getCheckBoxTopColor(bool hovered, bool pressed, bool checked) -{ - const QColor color = getCheckBoxBottomColor(hovered, pressed, checked); - - // TODO: separate this from Adwaita::Helper::renderCheckBoxFrame() - if (!checked) { - if (pressed) { - // Pressed button in normal and dark mode is not a gradient, but just an image consting from same $color - return color; - } else if (hovered) { - QColor baseColor = m_darkMode ? color : Adwaita::Colors::darken(color, 0.09); - return m_darkMode ? color : Adwaita::Colors::lighten(baseColor, 0.04); - } else { - return m_darkMode ? color : color; - } - } else { - return Adwaita::Colors::lighten(color, 0.04); - } -} - -QColor AdwaitaTheme::getCheckBoxOutlineColor(bool hovered, bool pressed, bool checked) -{ - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setMouseOver(hovered); - styleOptions.setSunken(pressed); - styleOptions.setCheckboxState(checked ? Adwaita::CheckBoxState::CheckOn : Adwaita::CheckBoxState::CheckOff); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - return Adwaita::Colors::indicatorOutlineColor(styleOptions); -} - -QColor AdwaitaTheme::getProgressBarColor() -{ - return m_palette.currentColorGroup() ? m_palette.color(QPalette::Window) : Adwaita::Colors::mix(getProgressBarOutlineColor(), m_palette.color(QPalette::Window)); -} - -QColor AdwaitaTheme::getProgressBarOutlineColor() -{ - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - return Adwaita::Colors::buttonOutlineColor(styleOptions); -} - -QColor AdwaitaTheme::getScrollBarGrooveColor() -{ - if (m_darkMode) { - return Adwaita::Colors::mix(windowColor(), baseColor(), 0.5); - } else { - return Adwaita::Colors::mix(windowColor(), baseColor(), 0.2); - } -} - -QColor AdwaitaTheme::getScrollBarHandleColor(bool hovered, bool pressed) -{ - Adwaita::StyleOptions styleOptions(m_palette); - styleOptions.setMouseOver(hovered); - styleOptions.setSunken(pressed); - styleOptions.setColorVariant(m_darkMode ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita); - - return Adwaita::Colors::scrollBarHandleColor(styleOptions); -} diff --git a/src/theme/theme.h b/src/theme/theme.h deleted file mode 100644 index fde32751..00000000 --- a/src/theme/theme.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Fedora Media Writer - * Copyright (C) 2020 Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef ADWAITA_THEME_H -#define ADWAITA_THEME_H - -#include -#include -#include -#include - -#include -#include - -class AdwaitaTheme : public QObject -{ - Q_OBJECT - // Button - Q_PROPERTY(int buttonMarginHeight READ buttonMarginHeight CONSTANT) - Q_PROPERTY(int buttonMarginWidth READ buttonMarginWidth CONSTANT) - Q_PROPERTY(int buttonMinimumHeight READ buttonMinimumHeight CONSTANT) - Q_PROPERTY(int buttonMinimumWidth READ buttonMinimumWidth CONSTANT) - Q_PROPERTY(int buttonItemSpacing READ buttonItemSpacing CONSTANT) - - // Checkbox - Q_PROPERTY(int checkboxItemSpacing READ checkboxItemSpacing CONSTANT) - Q_PROPERTY(int checkboxFocusMarginWidth READ checkboxFocusMarginWidth CONSTANT) - Q_PROPERTY(int checkboxSize READ checkboxSize CONSTANT) - - // ComboBox - Q_PROPERTY(int comboBoxMarginHeight READ comboBoxMarginHeight CONSTANT) - Q_PROPERTY(int comboBoxMarginWidth READ comboBoxMarginWidth CONSTANT) - Q_PROPERTY(int comboBoxMinimumHeight READ comboBoxMinimumHeight CONSTANT) - Q_PROPERTY(int comboBoxMinimumWidth READ comboBoxMinimumWidth CONSTANT) - - // Frame - Q_PROPERTY(int frameRadius READ frameRadius CONSTANT) - Q_PROPERTY(int frameWidth READ frameWidth CONSTANT) - - // LineEdit - Q_PROPERTY(int lineEditFrameWidth READ lineEditFrameWidth CONSTANT) - Q_PROPERTY(int lineEditMarginHeight READ lineEditMarginHeight CONSTANT) - Q_PROPERTY(int lineEditMarginWidth READ lineEditMarginWidth CONSTANT) - Q_PROPERTY(int lineEditMinimumHeight READ lineEditMinimumHeight CONSTANT) - Q_PROPERTY(int lineEditMinimumWidth READ lineEditMinimumWidth CONSTANT) - - // MenuItem - Q_PROPERTY(int menuItemSpacing READ menuItemSpacing CONSTANT) - Q_PROPERTY(int menuItemMarginWidth READ menuItemMarginWidth CONSTANT) - - // Progressbar - Q_PROPERTY(int progressBarBusyIndicatorSize READ progressBarBusyIndicatorSize CONSTANT) - Q_PROPERTY(int progressBarThickness READ progressBarThickness CONSTANT) - - // Colors - Q_PROPERTY(QColor baseColor READ baseColor CONSTANT) - Q_PROPERTY(QColor buttonColor READ buttonColor CONSTANT) - Q_PROPERTY(QColor buttonOutlineColor READ buttonOutlineColor CONSTANT) - Q_PROPERTY(QColor disabledTextColor READ disabledTextColor CONSTANT) - Q_PROPERTY(QColor highlightColor READ highlightColor CONSTANT) - Q_PROPERTY(QColor highlightTextColor READ highlightTextColor CONSTANT) - Q_PROPERTY(QColor linkColor READ linkColor CONSTANT) - Q_PROPERTY(QColor textColor READ textColor CONSTANT) - Q_PROPERTY(QColor windowColor READ windowColor CONSTANT) - - Q_PROPERTY(QColor darkMode READ darkMode CONSTANT) -public: - explicit AdwaitaTheme(QObject *parent = nullptr); - ~AdwaitaTheme() override = default; - - static AdwaitaTheme *qmlAttachedProperties(QObject *object); - - // Button - int buttonMarginHeight() const - { - return Adwaita::Button_MarginHeight; - } - int buttonMarginWidth() const - { - return Adwaita::Button_MarginWidth; - } - int buttonMinimumHeight() const - { - return Adwaita::Button_MinHeight; - } - int buttonMinimumWidth() const - { - return Adwaita::Button_MinWidth; - } - int buttonItemSpacing() const - { - return Adwaita::Button_ItemSpacing; - } - - // Checkbox - int checkboxItemSpacing() const - { - return Adwaita::CheckBox_ItemSpacing; - } - int checkboxFocusMarginWidth() const - { - return Adwaita::CheckBox_FocusMarginWidth; - } - int checkboxSize() const - { - return Adwaita::CheckBox_Size; - } - - // ComboBox - int comboBoxMarginHeight() const - { - return Adwaita::ComboBox_MarginHeight; - } - int comboBoxMarginWidth() const - { - return Adwaita::ComboBox_MarginWidth; - } - int comboBoxMinimumHeight() const - { - return Adwaita::ComboBox_MinHeight; - } - int comboBoxMinimumWidth() const - { - return Adwaita::ComboBox_MinWidth; - } - - // Frame - int frameRadius() const - { - return Adwaita::Frame_FrameRadius; - } - int frameWidth() const - { - return Adwaita::Frame_FrameWidth; - } - - // LineEdit - int lineEditFrameWidth() const - { - return Adwaita::LineEdit_FrameWidth; - } - int lineEditMarginHeight() const - { - return Adwaita::LineEdit_MarginHeight; - } - int lineEditMarginWidth() const - { - return Adwaita::LineEdit_MarginWidth; - } - int lineEditMinimumHeight() const - { - return Adwaita::LineEdit_MinHeight; - } - int lineEditMinimumWidth() const - { - return Adwaita::LineEdit_MinWidth; - } - - // MenuItem - int menuItemSpacing() const - { - return Adwaita::MenuItem_ItemSpacing; - } - int menuItemMarginWidth() const - { - return Adwaita::MenuItem_MarginWidth; - } - - // Progressbar - int progressBarBusyIndicatorSize() const - { - return Adwaita::ProgressBar_BusyIndicatorSize; - } - int progressBarThickness() const - { - return Adwaita::ProgressBar_Thickness; - } - - // Base colors - QColor baseColor() const - { - return m_palette.color(QPalette::Base); - } - QColor buttonColor() const - { - return m_palette.color(QPalette::Button); - } - QColor buttonOutlineColor() const; - QColor disabledTextColor() const - { - return m_palette.color(QPalette::Disabled, QPalette::Text); - } - QColor highlightColor() const - { - return m_palette.color(QPalette::Highlight); - } - QColor highlightTextColor() const - { - return m_palette.color(QPalette::HighlightedText); - } - QColor linkColor() const - { - return m_palette.color(QPalette::Link); - } - QColor textColor() const - { - return m_palette.color(QPalette::Text); - } - QColor windowColor() const - { - return m_palette.color(QPalette::Window); - } - - // Advanced colors - Q_INVOKABLE QColor getButtonBottomColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed); - Q_INVOKABLE QColor getButtonTopColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed); - Q_INVOKABLE QColor getButtonOutlineColor(bool highlighted, bool destructiveAction, bool hovered, bool pressed); - - Q_INVOKABLE QColor getCheckBoxBottomColor(bool hovered, bool pressed, bool checked); - Q_INVOKABLE QColor getCheckBoxTopColor(bool hovered, bool pressed, bool checked); - Q_INVOKABLE QColor getCheckBoxOutlineColor(bool hovered, bool pressed, bool checked); - - Q_INVOKABLE QColor getProgressBarColor(); - Q_INVOKABLE QColor getProgressBarOutlineColor(); - - Q_INVOKABLE QColor getScrollBarGrooveColor(); - Q_INVOKABLE QColor getScrollBarHandleColor(bool hovered, bool pressed); - - bool darkMode() const - { - return m_darkMode; - } - -private: - bool m_darkMode; - QPalette m_palette; -}; - -QML_DECLARE_TYPEINFO(AdwaitaTheme, QML_HAS_ATTACHED_PROPERTIES) - -#endif // ADWAITA_THEME_H diff --git a/src/theme/theme.pro b/src/theme/theme.pro deleted file mode 100644 index b20c553b..00000000 --- a/src/theme/theme.pro +++ /dev/null @@ -1,46 +0,0 @@ -TEMPLATE = lib - -CONFIG += link_pkgconfig qt plugin qmltypes -PKGCONFIG += adwaita-qt - -TARGET = adwaitathemeplugin - -QT += qml quick quickcontrols2 widgets - -CONFIG += c++11 - -HEADERS += adwaitathemeplugin.h \ - icon.h \ - theme.h - -SOURCES += adwaitathemeplugin.cpp \ - icon.cpp \ - theme.cpp - -QML_IMPORT_NAME = org.fedoraproject.AdwaitaTheme -QML_IMPORT_MAJOR_VERSION = 2 - -lupdate_only { - SOURCES += $$PWD/qml/*.qml \ - $$PWD/qml/private/*.qml \ - $$PWD/*.cpp - HEADERS += $$PWD/*.h -} - -qml.files += $$PWD/qml/*.qml -qml.path = $$[QT_INSTALL_QML]/QtQuick/Controls.2/org.fedoraproject.AdwaitaTheme - -qmlprivate.files += $$PWD/qml/private/*.qml -qmlprivate.path = $$[QT_INSTALL_QML]/QtQuick/Controls.2/org.fedoraproject.AdwaitaTheme/private - -qmldir.files += qmldir -qmldir.path = $$[QT_INSTALL_QML]/org/fedoraproject/AdwaitaTheme - -target.path = $$[QT_INSTALL_QML]/org/fedoraproject/AdwaitaTheme - -INSTALLS += target qml qmlprivate qmldir - -macx { - QMAKE_MOC_OPTIONS += -Muri=org.fedoraproject.AdwaitaTheme - QMAKE_BUNDLE_DATA += target qml qmlprivate qmldir -} From 43acd55d77299ee674c91e9743e61d659f31d0ba Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Wed, 25 Oct 2023 08:47:41 +0200 Subject: [PATCH 2/2] Translated using Weblate (Belarusian) (#661) Currently translated at 100.0% (154 of 154 strings) Added translation using Weblate (Belarusian) Translate-URL: https://translate.fedoraproject.org/projects/fedora-media-writer/mediawriter/be/ Translation: fedora-media-writer/MediaWriter Co-authored-by: Yahor Haurylenka --- po/mediawriter_be.po | 901 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 901 insertions(+) create mode 100644 po/mediawriter_be.po diff --git a/po/mediawriter_be.po b/po/mediawriter_be.po new file mode 100644 index 00000000..bd75fc53 --- /dev/null +++ b/po/mediawriter_be.po @@ -0,0 +1,901 @@ +# #-#-#-#-# desktop.pot (PACKAGE VERSION) #-#-#-#-# +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# "#-#-#-#-# mediawriter.pot (PACKAGE VERSION) #-#-#-#-#\n" +# Yahor Haurylenka , 2023. +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-03 13:56+0200\n" +"PO-Revision-Date: 2023-10-25 05:10+0000\n" +"Last-Translator: Yahor Haurylenka \n" +"Language-Team: Belarusian \n" +"Language: be\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 5.0.2\n" + +#: ../src/app/qml/AboutDialog.qml:50 +msgctxt "AboutDialog|" +msgid "About Fedora Media Writer" +msgstr "Аб Fedora Media Writer" + +#: ../src/app/qml/AboutDialog.qml:59 +#, qt-format +msgctxt "AboutDialog|" +msgid "Version %1" +msgstr "Версія %1" + +#: ../src/app/qml/AboutDialog.qml:66 +msgctxt "AboutDialog|" +msgid "Fedora Media Writer is now checking for new releases" +msgstr "Fedora Media Writer правярае наяўнасць новых выпускаў" + +#: ../src/app/qml/AboutDialog.qml:72 +#, qt-format +msgctxt "AboutDialog|" +msgid "Please report bugs or your suggestions on %1" +msgstr "Калі ласка, паведамляйце аб памылках або аб вашых прапановах на %1" + +#: ../src/app/qml/AboutDialog.qml:95 +msgctxt "AboutDialog|" +msgid "Close" +msgstr "Закрыць" + +#: ../src/app/qml/CancelDialog.qml:56 +msgctxt "CancelDialog|" +msgid "Cancel Download?" +msgstr "Скасаваць спампоўку?" + +#: ../src/app/qml/CancelDialog.qml:58 +msgctxt "CancelDialog|" +msgid "Cancel Writing?" +msgstr "Скасаваць запіс?" + +#: ../src/app/qml/CancelDialog.qml:60 +msgctxt "CancelDialog|" +msgid "Cancel Verification?" +msgstr "Адмяніць праверку?" + +#: ../src/app/qml/CancelDialog.qml:67 +msgctxt "CancelDialog|" +msgid "" +"Download and media writing will be aborted. This process can be resumed any " +"time later." +msgstr "" +"Спампоўка і запіс мультымедыя будуць спынены. Гэты працэс можна аднавіць у " +"любы час пазней." + +#: ../src/app/qml/CancelDialog.qml:69 +msgctxt "CancelDialog|" +msgid "" +"Writing process will be aborted and your drive will have to be restored " +"afterwards." +msgstr "" +"Працэс запісу будзе спынены, і пасля гэтага ваш дыск трэба будзе аднавіць." + +#: ../src/app/qml/CancelDialog.qml:71 +msgctxt "CancelDialog|" +msgid "This operation is safe to be cancelled." +msgstr "Гэтую аперацыю можна бяспечна скасаваць." + +#: ../src/app/qml/CancelDialog.qml:88 +msgctxt "CancelDialog|" +msgid "Continue" +msgstr "Працягнуць" + +#: ../src/app/qml/CancelDialog.qml:111 +msgctxt "CancelDialog|" +msgid "Cancel Download" +msgstr "Скасаваць спампоўку" + +#: ../src/app/qml/CancelDialog.qml:113 +msgctxt "CancelDialog|" +msgid "Cancel Writing" +msgstr "Скасаваць запіс" + +#: ../src/app/qml/CancelDialog.qml:115 +msgctxt "CancelDialog|" +msgid "Cancel Verification" +msgstr "Адмяніць праверку" + +#: ../src/app/downloadmanager.cpp:235 +msgctxt "Download|" +msgid "Unable to fetch the requested image." +msgstr "Немагчыма атрымаць запытаны вобраз." + +#: ../src/app/downloadmanager.cpp:335 +msgctxt "Download|" +msgid "You ran out of space in your Downloads folder." +msgstr "У вас скончылася месца ў папцы \"Спампоўкі\"." + +#: ../src/app/downloadmanager.cpp:337 +msgctxt "Download|" +msgid "The download file is not writable." +msgstr "Файл спампоўкі недаступны для запісу." + +#: ../src/app/downloadmanager.cpp:425 +msgctxt "Download|" +msgid "Connection timed out" +msgstr "Тайм-аўт падлучэння" + +#: ../src/app/qml/DownloadPage.qml:52 +#, qt-format +msgctxt "DownloadPage|" +msgid "%1 Successfully Written" +msgstr "%1 паспяхова запісана" + +#: ../src/app/qml/DownloadPage.qml:54 +#, qt-format +msgctxt "DownloadPage|" +msgid "Writing %1" +msgstr "Запісваецца %1" + +#: ../src/app/qml/DownloadPage.qml:56 +#, qt-format +msgctxt "DownloadPage|" +msgid "Downloading %1" +msgstr "Спампоўванне %1" + +#: ../src/app/qml/DownloadPage.qml:58 +#, qt-format +msgctxt "DownloadPage|" +msgid "Preparing %1" +msgstr "Падрыхтоўка %1" + +#: ../src/app/qml/DownloadPage.qml:60 +#, qt-format +msgctxt "DownloadPage|" +msgid "Ready to write %1" +msgstr "Гатовы да запісу %1" + +#: ../src/app/qml/DownloadPage.qml:62 +#, qt-format +msgctxt "DownloadPage|" +msgid "Failed to download %1" +msgstr "Не ўдалося спампаваць %1" + +#: ../src/app/qml/DownloadPage.qml:76 +msgctxt "DownloadPage|" +msgid " B left)" +msgstr " Б засталося)" + +#: ../src/app/qml/DownloadPage.qml:77 +msgctxt "DownloadPage|" +msgid " KB left)" +msgstr " Кб засталося)" + +#: ../src/app/qml/DownloadPage.qml:78 +msgctxt "DownloadPage|" +msgid " MB left)" +msgstr " МБ засталося)" + +#: ../src/app/qml/DownloadPage.qml:79 +msgctxt "DownloadPage|" +msgid " GB left)" +msgstr " ГБ засталося)" + +#: ../src/app/qml/DownloadPage.qml:82 ../src/app/qml/DownloadPage.qml:83 +#: ../src/app/qml/DownloadPage.qml:84 ../src/app/qml/DownloadPage.qml:85 +#, qt-format +msgctxt "DownloadPage|" +msgid " (%1" +msgstr " (%1" + +#: ../src/app/qml/DownloadPage.qml:101 +msgctxt "DownloadPage|" +msgid "Your drive was unplugged during the process" +msgstr "Ваш дыск быў адключаны падчас працэсу" + +#: ../src/app/qml/DownloadPage.qml:135 +msgctxt "DownloadPage|" +msgid "Downloads are saved to the downloads folder." +msgstr "Спампоўкі захоўваюцца ў папку спамповак." + +#: ../src/app/qml/DownloadPage.qml:143 +#, qt-format +msgctxt "DownloadPage|" +msgid "By writing, you will lose all of the data on %1." +msgstr "Запіс прывядзе да страты ўсіх даных на %1." + +#: ../src/app/qml/DownloadPage.qml:151 +msgctxt "DownloadPage|" +msgid "Please insert an USB drive." +msgstr "Калі ласка, устаўце USB дыск." + +#: ../src/app/qml/DownloadPage.qml:159 +msgctxt "DownloadPage|" +msgid "" +"Your drive will be resized to a smaller capacity. You may resize it back to " +"normal by using Fedora Media Writer. This will remove installation media " +"from your drive." +msgstr "" +"Памер вашага дыска будзе зменены да меншага аб'ёму. Вы можаце вярнуць яго " +"памер з дапамогай Fedora Media Writer. Гэта прывядзе да выдалення " +"ўсталявальных файлаў з вашага дыска." + +#: ../src/app/qml/DownloadPage.qml:167 +msgctxt "DownloadPage|" +msgid "Selected:" +msgstr "Выбранае:" + +#: ../src/app/qml/DownloadPage.qml:167 +msgctxt "DownloadPage|" +msgid "None" +msgstr "Нічога" + +#: ../src/app/qml/DownloadPage.qml:175 +#, qt-format +msgctxt "DownloadPage|" +msgid "" +"Your board or device is not supported by Fedora Media Writer yet. Please " +"check this page for more information about its compatibility " +"with Fedora and how to create bootable media for it." +msgstr "" +"Fedora Media Writer пакуль не падтрымлівае вашу плату ці прыладу. Праверце " +"гэтую старонку для атрымання дадатковай інфармацыі аб іх " +"сумяшчальнасці з Fedora і аб тым, як стварыць для іх загрузачны носьбіт." + +#: ../src/app/qml/DownloadPage.qml:184 +#, qt-format +msgctxt "DownloadPage|" +msgid "" +"The selected drive's size is %1. It's possible you have selected an external " +"drive by accident!" +msgstr "Памер выбранага дыска %1. Магчыма, вы выпадкова выбралі знешні дыск!" + +#: ../src/app/qml/DownloadPage.qml:193 +#, qt-format +msgctxt "DownloadPage|" +msgid "Restart and boot from %1 to start using %2." +msgstr "" +"Перазапусціце камп'ютар і загрузіце сістэму з %1, каб пачаць выкарыстоўваць " +"%2." + +#: ../src/app/drivemanager.cpp:308 +msgctxt "Drive|" +msgid "This drive is not large enough." +msgstr "На гэтым дыску недастаткова месца." + +#: ../src/app/qml/DrivePage.qml:36 +msgctxt "DrivePage|" +msgid "Write Options" +msgstr "Параметры запісу" + +#: ../src/app/qml/DrivePage.qml:45 +msgctxt "DrivePage|" +msgid "Version" +msgstr "Версія" + +#: ../src/app/qml/DrivePage.qml:67 +msgctxt "DrivePage|" +msgid "Hardware Architecture" +msgstr "Апаратная архітэктура" + +#: ../src/app/qml/DrivePage.qml:84 +msgctxt "DrivePage|" +msgid "Selected file" +msgstr "Выбраны файл" + +#: ../src/app/qml/DrivePage.qml:91 +msgctxt "DrivePage|" +msgid "None" +msgstr "Няма" + +#: ../src/app/qml/DrivePage.qml:99 +msgctxt "DrivePage|" +msgid "Select..." +msgstr "Выбраць..." + +#: ../src/app/qml/DrivePage.qml:116 +msgctxt "DrivePage|" +msgid "Image files" +msgstr "Файлы образаў" + +#: ../src/app/qml/DrivePage.qml:116 +msgctxt "DrivePage|" +msgid "All files (*)" +msgstr "Усе файлы (*)" + +#: ../src/app/qml/DrivePage.qml:127 +msgctxt "DrivePage|" +msgid "USB Drive" +msgstr "USB дыск" + +#: ../src/app/qml/DrivePage.qml:135 +msgctxt "DrivePage|" +msgid "There are no portable drives connected" +msgstr "Няма падлучаных пераносных накапляльнікаў" + +#: ../src/app/qml/DrivePage.qml:155 +msgctxt "DrivePage|" +msgid "Download" +msgstr "Спампаваць" + +#: ../src/app/qml/DrivePage.qml:160 +msgctxt "DrivePage|" +msgid "Delete download after writing" +msgstr "Выдаліць спампоўку пасля запісу" + +#: ../src/app/linuxdrivemanager.cpp:199 +msgctxt "LinuxDrive|" +msgid "The drive was removed while it was written to." +msgstr "Дыск быў выдалены падчас запісу." + +#: ../src/app/linuxdrivemanager.cpp:224 +msgctxt "LinuxDrive|" +msgid "Could not find the helper binary. Check your installation." +msgstr "Не ўдалося знайсці дапаможны бінарны файл. Праверце ўсталяванне." + +#: ../src/app/linuxdrivemanager.cpp:259 +msgctxt "LinuxDrive|" +msgid "Stopped before writing has finished." +msgstr "Спынена да завяршэння запісу." + +#: ../src/app/linuxdrivemanager.cpp:327 +msgctxt "LinuxDrive|" +msgid "Finished!" +msgstr "Гатова!" + +#: ../src/app/linuxdrivemanager.cpp:327 +#, qt-format +msgctxt "LinuxDrive|" +msgid "Writing %1 was successful" +msgstr "Паспяховы запіс %1" + +#: ../src/app/linuxdrivemanager.cpp:349 +msgctxt "LinuxDrive|" +msgid "Error" +msgstr "Памылка" + +#: ../src/app/linuxdrivemanager.cpp:349 +#, qt-format +msgctxt "LinuxDrive|" +msgid "Writing %1 failed" +msgstr "Памылка запісу %1" + +#: ../src/app/linuxdrivemanager.cpp:121 +msgctxt "LinuxDriveProvider|" +msgid "UDisks2 seems to be unavailable or unaccessible on your system." +msgstr "Здаецца, UDisks2 адсутнічае, ці да яго няма доступу на вашай сістэме." + +#: ../src/app/macdrivemanager.cpp:104 +msgctxt "MacDrive|" +msgid "Could not find the helper binary. Check your installation." +msgstr "Не ўдалося знайсці дапаможны бінарны файл. Праверце ўсталяванне." + +#: ../src/app/macdrivemanager.cpp:187 +msgctxt "MacDrive|" +msgid "Error" +msgstr "Памылка" + +#: ../src/app/macdrivemanager.cpp:187 +#, qt-format +msgctxt "MacDrive|" +msgid "Writing %1 failed" +msgstr "Памылка запісу %1" + +#: ../src/app/macdrivemanager.cpp:190 +msgctxt "MacDrive|" +msgid "Finished!" +msgstr "Гатова!" + +#: ../src/app/macdrivemanager.cpp:190 +#, qt-format +msgctxt "MacDrive|" +msgid "Writing %1 was successful" +msgstr "Паспяховы запіс %1" + +#: ../src/app/qml/MainPage.qml:43 +msgctxt "MainPage|" +msgid "Select Image Source" +msgstr "Абярыце крыніцу вобразу" + +#: ../src/app/qml/MainPage.qml:57 +msgctxt "MainPage|" +msgid "Download automatically" +msgstr "Спампаваць аўтаматычна" + +#: ../src/app/qml/MainPage.qml:65 +msgctxt "MainPage|" +msgid "Select .iso file" +msgstr "Выбраць .iso файл" + +#: ../src/app/qml/MainPage.qml:76 +#, qt-format +msgctxt "MainPage|" +msgid "Restore %1" +msgstr "Аднавіць %1" + +#: ../src/app/portalfiledialog.cpp:143 +msgctxt "PortalFileDialog|" +msgid "Image files" +msgstr "Файлы вобразаў" + +#: ../src/app/portalfiledialog.cpp:153 +msgctxt "PortalFileDialog|" +msgid "All files" +msgstr "Усе файлы" + +#: ../src/app/portalfiledialog.cpp:162 +msgctxt "PortalFileDialog|" +msgid "Open File" +msgstr "Адкрыць файл" + +#: ../src/app/releasemanager.cpp:392 +msgctxt "Release|" +msgid "Pick a file from your drive(s)" +msgstr "Выберыце файл са свайго дыска" + +#: ../src/app/releasemanager.cpp:393 +msgctxt "Release|" +msgid "" +"

Here you can choose a OS image from your hard drive to be written to your " +"flash disk

Currently it is only supported to write raw disk images (." +"iso or .bin)

" +msgstr "" +"

Тут можна абраць вобраз АС з цвёрдага дыску для запісу на " +"флэш-накапляльнік

Зараз падтрымліваецца толькі запіс raw-вобразаў " +"дыску (.iso або .bin)

" + +#: ../src/app/releasemanager.cpp:423 +msgctxt "Release|" +msgid "Fedora Spins" +msgstr "Fedora Spins" + +#: ../src/app/releasemanager.cpp:425 +msgctxt "Release|" +msgid "Fedora Labs" +msgstr "Fedora Labs" + +#: ../src/app/releasemanager.cpp:427 +msgctxt "Release|" +msgid "Emerging Fedora Editions" +msgstr "Новыя выпускі Fedora" + +#: ../src/app/releasemanager.cpp:429 +msgctxt "Release|" +msgid "Other" +msgstr "Іншае" + +#: ../src/app/releasemanager.cpp:1069 +msgctxt "ReleaseArchitecture|" +msgid "Intel/AMD 64bit" +msgstr "Intel/AMD 64-бітныя" + +#: ../src/app/releasemanager.cpp:1069 +msgctxt "ReleaseArchitecture|" +msgid "ISO format image for Intel, AMD and other compatible PCs (64-bit)" +msgstr "" +"Вобраз у фармаце ISO для ПК на базе Intel, AMD і іншых сумяшчальных ПК " +"(64-разрадных)" + +#: ../src/app/releasemanager.cpp:1070 +msgctxt "ReleaseArchitecture|" +msgid "Intel/AMD 32bit" +msgstr "Intel/AMD 32-бітныя" + +#: ../src/app/releasemanager.cpp:1070 +msgctxt "ReleaseArchitecture|" +msgid "ISO format image for Intel, AMD and other compatible PCs (32-bit)" +msgstr "" +"Вобраз у фармаце ISO для ПК на базе Intel, AMD і іншых сумяшчальных ПК " +"(32-разрадных)" + +#: ../src/app/releasemanager.cpp:1071 +msgctxt "ReleaseArchitecture|" +msgid "ARM v7" +msgstr "ARM v7" + +#: ../src/app/releasemanager.cpp:1071 +msgctxt "ReleaseArchitecture|" +msgid "" +"LZMA-compressed raw image for ARM v7-A machines like the Raspberry Pi 2 and 3" +msgstr "" +"Сціснуты метадам LZMA, raw-выява для камп'ютараў з ARM v7-A, напрыклад, " +"Raspberry Pi 2 і 3" + +#: ../src/app/releasemanager.cpp:1072 +msgctxt "ReleaseArchitecture|" +msgid "AArch64" +msgstr "AArch64" + +#: ../src/app/releasemanager.cpp:1072 +msgctxt "ReleaseArchitecture|" +msgid "LZMA-compressed raw image for AArch64 machines" +msgstr "Сціснуты метадам LZMA, raw-вобраз для камп'ютараў з AArch64" + +#: ../src/app/releasemanager.cpp:391 +msgctxt "ReleaseListModel|" +msgid "Custom image" +msgstr "Іншы вобраз" + +#: ../src/app/releasemanager.cpp:928 ../src/app/releasemanager.cpp:940 +msgctxt "ReleaseVariant|" +msgid "The downloaded image is corrupted" +msgstr "Загружаны вобраз пашкоджаны" + +#: ../src/app/releasemanager.cpp:944 +msgctxt "ReleaseVariant|" +msgid "The downloaded file is not readable." +msgstr "Спампаваны файл не чытаецца." + +#: ../src/app/releasemanager.cpp:955 +msgctxt "ReleaseVariant|" +msgid "Unable to rename the temporary file." +msgstr "Немагчыма перайменаваць часовы файл." + +#: ../src/app/releasemanager.h:372 +msgctxt "ReleaseVariant|" +msgid "Preparing" +msgstr "Падрыхтоўка" + +#: ../src/app/releasemanager.h:373 +msgctxt "ReleaseVariant|" +msgid "Downloading" +msgstr "Спампоўка" + +#: ../src/app/releasemanager.h:374 +msgctxt "ReleaseVariant|" +msgid "Checking the download" +msgstr "Праверка спампоўкі" + +#: ../src/app/releasemanager.h:375 +msgctxt "ReleaseVariant|" +msgid "Ready to write" +msgstr "Гатова да запісу" + +#: ../src/app/releasemanager.h:376 +msgctxt "ReleaseVariant|" +msgid "Image file was saved to your downloads folder. Writing is not possible" +msgstr "Файл вобраза захаваны ў вашу папку для спамповак. Запіс немагчымы" + +#: ../src/app/releasemanager.h:377 +msgctxt "ReleaseVariant|" +msgid "Writing" +msgstr "Запіс" + +#: ../src/app/releasemanager.h:378 +msgctxt "ReleaseVariant|" +msgid "Checking the written data" +msgstr "Праверка запісаных даных" + +#: ../src/app/releasemanager.h:379 +msgctxt "ReleaseVariant|" +msgid "Finished!" +msgstr "Гатова!" + +#: ../src/app/releasemanager.h:380 +msgctxt "ReleaseVariant|" +msgid "The written data is corrupted" +msgstr "Запісаныя даныя пашкоджаны" + +#: ../src/app/releasemanager.h:381 +msgctxt "ReleaseVariant|" +msgid "Download failed" +msgstr "Памылка спампоўкі" + +#: ../src/app/releasemanager.h:382 +msgctxt "ReleaseVariant|" +msgid "Error" +msgstr "Памылка" + +#: ../src/app/releasemanager.cpp:701 +#, qt-format +msgctxt "ReleaseVersion|" +msgid "%1 Alpha" +msgstr "%1 Alpha" + +#: ../src/app/releasemanager.cpp:703 +#, qt-format +msgctxt "ReleaseVersion|" +msgid "%1 Beta" +msgstr "%1 Beta" + +#: ../src/app/releasemanager.cpp:705 +#, qt-format +msgctxt "ReleaseVersion|" +msgid "%1 Release Candidate" +msgstr "Кандыдат на выпуск %1" + +#: ../src/app/qml/RestorePage.qml:37 +#, qt-format +msgctxt "RestorePage|" +msgid "Restore Drive %1" +msgstr "Аднавіць дыск %1" + +#: ../src/app/qml/RestorePage.qml:49 +msgctxt "RestorePage|" +msgid "" +"

To reclaim all space available on the drive, it has to " +"be restored to its factory settings. The live system and all saved data will " +"be deleted.

You don't need to restore the drive " +"if you want to write another live system to it. \n" +"

Do you want to restore it to " +"factory settings?

" +msgstr "" +"

Каб вярнуць усю наяўную на дыску прастору, трэба " +"аднавіць завадскія налады дыска. Будуць выдалены live-сістэма і ўсе " +"захаваныя дадзеныя.

Не трэба аднаўляць дыск, калі " +"вы хочаце запісаць на яго яшчэ адну live-сістэму.\n" +"

Хочаце аднавіць завадскія " +"налады?

" + +#: ../src/app/qml/RestorePage.qml:67 +msgctxt "RestorePage|" +msgid "" +"

Please wait while Fedora Media Writer restores your " +"portable drive.

" +msgstr "" +"

Пачакайце, пакуль Fedora Media Writer аднаўляе ваш " +"пераносны дыск.

" + +#: ../src/app/qml/RestorePage.qml:84 +msgctxt "RestorePage|" +msgid "Your drive was successfully restored!" +msgstr "Ваш дыск паспяхова адноўлены!" + +#: ../src/app/qml/RestorePage.qml:94 +msgctxt "RestorePage|" +msgid "" +"Unfortunately, an error occurred during the process. Please try restoring " +"the drive using your system tools." +msgstr "" +"Нажаль, падчас гэтага працэсу адбылася памылка. Паспрабуйце аднавіць дыск " +"сродкамі сістэмы." + +#: ../src/app/qml/RestorePage.qml:143 +msgctxt "RestorePage|" +msgid "Restoring finished" +msgstr "Аднаўленне завершана" + +#: ../src/app/qml/VersionPage.qml:35 +msgctxt "VersionPage|" +msgid "Select Fedora Release" +msgstr "Выберыце выпуск Fedora" + +#: ../src/app/qml/VersionPage.qml:48 +msgctxt "VersionPage|" +msgid "Select from:" +msgstr "Выбраць з:" + +#: ../src/app/qml/VersionPage.qml:53 +msgctxt "VersionPage|" +msgid "Official Editions" +msgstr "Афіцыйныя рэдакцыі" + +#: ../src/app/qml/VersionPage.qml:59 +msgctxt "VersionPage|" +msgid "Emerging Editions" +msgstr "Новыя рэдакцыі" + +#: ../src/app/qml/VersionPage.qml:65 +msgctxt "VersionPage|" +msgid "Spins" +msgstr "Зборкі" + +#: ../src/app/qml/VersionPage.qml:71 +msgctxt "VersionPage|" +msgid "Labs" +msgstr "Labs" + +#: ../src/app/windrivemanager.cpp:265 +msgctxt "WinDrive|" +msgid "Could not find the helper binary. Check your installation." +msgstr "Не ўдалося знайсці дапаможны бінарны файл. Праверце ўсталяванне." + +#: ../src/app/windrivemanager.cpp:350 ../src/app/windrivemanager.cpp:401 +msgctxt "WinDrive|" +msgid "Finished!" +msgstr "Гатова!" + +#: ../src/app/windrivemanager.cpp:350 ../src/app/windrivemanager.cpp:401 +#, qt-format +msgctxt "WinDrive|" +msgid "Writing %1 was successful" +msgstr "Паспяховы запіс %1" + +#: ../src/helper/linux/writejob.cpp:143 ../src/helper/mac/writejob.cpp:225 +#: ../src/helper/win/writejob.cpp:271 +msgctxt "WriteJob|" +msgid "Failed to start decompressing." +msgstr "Не ўдалося пачаць распакаванне." + +#: ../src/helper/linux/writejob.cpp:168 ../src/helper/linux/writejob.cpp:198 +#: ../src/helper/linux/writejob.cpp:236 ../src/helper/mac/writejob.cpp:185 +#: ../src/helper/mac/writejob.cpp:250 ../src/helper/mac/writejob.cpp:280 +#: ../src/helper/win/writejob.cpp:188 ../src/helper/win/writejob.cpp:195 +msgctxt "WriteJob|" +msgid "Destination drive is not writable" +msgstr "Дыск прызначэння недаступны для запісу" + +#: ../src/helper/linux/writejob.cpp:177 ../src/helper/mac/writejob.cpp:259 +#: ../src/helper/win/writejob.cpp:315 +msgctxt "WriteJob|" +msgid "There is not enough memory to decompress the file." +msgstr "Недастаткова памяці для распакавання файла." + +#: ../src/helper/linux/writejob.cpp:182 ../src/helper/mac/writejob.cpp:264 +#: ../src/helper/win/writejob.cpp:320 +msgctxt "WriteJob|" +msgid "The downloaded compressed file is corrupted." +msgstr "Спампаваны сціснуты файл пашкоджаны." + +#: ../src/helper/linux/writejob.cpp:185 ../src/helper/mac/writejob.cpp:267 +#: ../src/helper/win/writejob.cpp:323 +msgctxt "WriteJob|" +msgid "Unsupported compression options." +msgstr "Параметры сціску не падтрымліваюцца." + +#: ../src/helper/linux/writejob.cpp:188 ../src/helper/mac/writejob.cpp:270 +#: ../src/helper/win/writejob.cpp:326 +msgctxt "WriteJob|" +msgid "Unknown decompression error." +msgstr "Невядомая памылка пры распакаванні." + +#: ../src/helper/linux/writejob.cpp:214 ../src/helper/linux/writejob.cpp:229 +#: ../src/helper/win/writejob.cpp:361 +msgctxt "WriteJob|" +msgid "Source image is not readable" +msgstr "Зыходны вобраз не чытаецца" + +#: ../src/helper/linux/writejob.cpp:266 ../src/helper/mac/writejob.cpp:304 +#: ../src/helper/win/writejob.cpp:406 +msgctxt "WriteJob|" +msgid "Your drive is probably damaged." +msgstr "Ваш дыск, магчыма, пашкоджаны." + +#: ../src/helper/linux/writejob.cpp:271 ../src/helper/mac/writejob.cpp:309 +#: ../src/helper/win/writejob.cpp:411 +msgctxt "WriteJob|" +msgid "Unexpected error occurred during media check." +msgstr "Падчас праверкі носьбіта адбылася непрадбачаная памылка." + +#: ../src/helper/mac/writejob.cpp:86 +msgctxt "WriteJob|" +msgid "Unable to allocate socket pair" +msgstr "Не ўдалося стварыць пару сокетаў" + +#: ../src/helper/mac/writejob.cpp:131 +msgctxt "WriteJob|" +msgid "Unable to open destination for writing" +msgstr "Не ўдалося адкрыць месца прызначэння для запісу" + +#: ../src/helper/win/writejob.cpp:74 +msgctxt "WriteJob|" +msgid "Couldn't open the drive for writing" +msgstr "Не атрымалася адкрыць дыск для запісу" + +#: ../src/helper/win/writejob.cpp:98 +msgctxt "WriteJob|" +msgid "Couldn't lock the drive" +msgstr "Не атрымалася заблакаваць дыск" + +#: ../src/helper/win/writejob.cpp:134 +#, qt-format +msgctxt "WriteJob|" +msgid "Couldn't remove the drive %1:" +msgstr "Не атрымалася выдаліць дыск %1:" + +#: ../src/helper/win/writejob.cpp:209 +msgctxt "WriteJob|" +msgid "Couldn't unlock the drive" +msgstr "Не ўдалося разблакаваць дыск" + +#: ../src/app/qml/main.qml:116 +msgctxt "main|" +msgid "Fedora Media Writer" +msgstr "Fedora Media Writer" + +#: ../src/app/qml/main.qml:154 +msgctxt "main|" +msgid "Select Fedora Version" +msgstr "Выбраць версію Fedora" + +#: ../src/app/qml/main.qml:170 +msgctxt "main|" +msgid "Select Drive" +msgstr "Выбраць дыск" + +#: ../src/app/qml/main.qml:250 ../src/app/qml/main.qml:291 +msgctxt "main|" +msgid "Restore" +msgstr "Аднавіць" + +#: ../src/app/qml/main.qml:290 ../src/app/qml/main.qml:304 +msgctxt "main|" +msgid "Finish" +msgstr "Гатова" + +#: ../src/app/qml/main.qml:294 ../src/app/qml/main.qml:302 +msgctxt "main|" +msgid "Write" +msgstr "Запісаць" + +#: ../src/app/qml/main.qml:296 +msgctxt "main|" +msgid "Download && Write" +msgstr "Спампаваць і запісаць" + +#: ../src/app/qml/main.qml:297 +msgctxt "main|" +msgid "Download & Write" +msgstr "Спампаваць і запісаць" + +#: ../src/app/qml/main.qml:300 ../src/app/qml/main.qml:315 +msgctxt "main|" +msgid "Cancel" +msgstr "Скасаваць" + +#: ../src/app/qml/main.qml:306 +msgctxt "main|" +msgid "Retry" +msgstr "Паўтарыць" + +#: ../src/app/qml/main.qml:308 +msgctxt "main|" +msgid "Next" +msgstr "Далей" + +#: ../src/app/qml/main.qml:313 +msgctxt "main|" +msgid "About" +msgstr "Аб праграме" + +#: ../src/app/qml/main.qml:316 +msgctxt "main|" +msgid "Previous" +msgstr "Назад" + +#. #-#-#-#-# appstream.pot (PACKAGE VERSION) #-#-#-#-# +#. (itstool) path: application/name +#: ../src/app/data/org.fedoraproject.MediaWriter.appdata.xml.in:8 +#: ../src/app/data/org.fedoraproject.MediaWriter.desktop:4 +msgid "Fedora Media Writer" +msgstr "Fedora Media Writer" + +#. (itstool) path: application/summary +#: ../src/app/data/org.fedoraproject.MediaWriter.appdata.xml.in:9 +msgid "A tool to create a live USB drive with an edition of Fedora" +msgstr "Інструмент для стварэння Live USB-дыска з Fedora" + +#. (itstool) path: description/p +#: ../src/app/data/org.fedoraproject.MediaWriter.appdata.xml.in:11 +msgid "" +"A tool to create a bootable live USB drive with an edition of Fedora. Not " +"only can Fedora Media Writer write an image to your flash drive, it can also " +"download it for you. It offers official editions (Server, Workstation), " +"Fedora spins (KDE Plasma Desktop, Xfce Desktop, Cinnamon Desktop,...), and " +"Fedora Labs (Design Suite, Security Lab,...). It provides basic information " +"about each of them to help you make the right choice." +msgstr "" +"Інструмент для стварэння загрузных Live USB-дыскаў з версіяй Fedora. Fedora " +"Media Writer можа не толькі запісаць выяву на флэш-накпляльнік, але і " +"спампаваць яго. Прапануюцца афіцыйныя версіі (Server, Workstation), Fedora " +"Spins (KDE Plasma Desktop, Xfce Desktop, Cinnamon Desktop, ...) і Fedora " +"Labs (Design Suite, Security Lab, ...). Прадастаўляецца асноўная інфармацыя " +"па кожным з іх, якая дапамагае зрабіць правільны выбар." + +#. (itstool) path: description/p +#: ../src/app/data/org.fedoraproject.MediaWriter.appdata.xml.in:12 +msgid "" +"Fedora Media Writer can also write other bootable ISOs loaded from your " +"local disk, but keep in mind that it's only tested with Fedora images." +msgstr "" +"Fedora Media Writer можа запісаць і іншыя загрузныя ISO-файлы, якія бяруцца " +"з вашага лакальнага дыска, але майце на ўвазе, што ён правераны толькі з " +"вобразамі Fedora." + +#: ../src/app/data/org.fedoraproject.MediaWriter.desktop:40 +msgid "Write Fedora images to your portable drives" +msgstr "Запіс вобразаў Fedora на пераносныя дыскі" + +#: ../src/app/data/org.fedoraproject.MediaWriter.desktop:81 +msgid "fmw;usb;iso;bootable;" +msgstr "fmw;usb;iso;bootable;"