2020-03-02 13:59:52 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2020 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
class TextEditorWidget;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-09 07:02:27 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
2020-03-02 13:59:52 +02:00
|
|
|
class QLabel;
|
|
|
|
|
class QToolButton;
|
2020-03-09 07:02:27 +01:00
|
|
|
QT_END_NAMESPACE
|
2020-03-02 13:59:52 +02:00
|
|
|
|
|
|
|
|
namespace Android {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class AndroidManifestEditorIconWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit AndroidManifestEditorIconWidget(QWidget *parent);
|
|
|
|
|
AndroidManifestEditorIconWidget(QWidget *parent,
|
2020-06-02 09:33:21 +03:00
|
|
|
const QSize &iconSize,
|
2020-03-02 13:59:52 +02:00
|
|
|
const QSize &buttonSize,
|
|
|
|
|
const QString &title,
|
|
|
|
|
const QString &tooltip,
|
|
|
|
|
TextEditor::TextEditorWidget *textEditorWidget = nullptr,
|
2020-06-09 16:25:13 +03:00
|
|
|
const QString &targetIconPath = {},
|
|
|
|
|
const QString &targetIconFileName = {});
|
2020-03-02 13:59:52 +02:00
|
|
|
void setIcon(const QIcon &icon);
|
2020-06-09 16:25:13 +03:00
|
|
|
void clearIcon();
|
2020-03-02 13:59:52 +02:00
|
|
|
void loadIcon();
|
|
|
|
|
void setIconFromPath(const QString &iconPath);
|
2020-06-09 16:25:13 +03:00
|
|
|
bool hasIcon() const;
|
|
|
|
|
void setScaledToOriginalAspectRatio(bool scaled);
|
|
|
|
|
void setScaledWithoutStretching(bool scaled);
|
|
|
|
|
void setTargetIconFileName(const QString &targetIconFileName);
|
|
|
|
|
void setTargetIconPath(const QString &targetIconPath);
|
|
|
|
|
QString targetIconFileName() const;
|
|
|
|
|
QString targetIconPath() const;
|
2020-03-02 13:59:52 +02:00
|
|
|
signals:
|
2020-06-09 16:25:13 +03:00
|
|
|
void iconSelected(const QString &path, AndroidManifestEditorIconWidget* iconWidget);
|
2020-06-02 09:33:21 +03:00
|
|
|
void iconRemoved();
|
2020-03-02 13:59:52 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void selectIcon();
|
|
|
|
|
void removeIcon();
|
|
|
|
|
void copyIcon();
|
|
|
|
|
void setScaleWarningLabelVisible(bool visible);
|
|
|
|
|
private:
|
|
|
|
|
QToolButton *m_button = nullptr;
|
2020-06-02 09:33:21 +03:00
|
|
|
QSize m_iconSize;
|
2020-03-02 13:59:52 +02:00
|
|
|
QSize m_buttonSize;
|
|
|
|
|
QLabel *m_scaleWarningLabel = nullptr;
|
|
|
|
|
TextEditor::TextEditorWidget *m_textEditorWidget = nullptr;
|
|
|
|
|
QString m_iconPath;
|
|
|
|
|
QString m_targetIconPath;
|
2020-06-09 16:25:13 +03:00
|
|
|
QString m_targetIconFileName;
|
2020-03-02 13:59:52 +02:00
|
|
|
QString m_iconSelectionText;
|
2020-06-09 16:25:13 +03:00
|
|
|
bool m_scaledToOriginalAspectRatio = false;
|
|
|
|
|
bool m_scaledWithoutStretching = false;
|
2020-03-02 13:59:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Android
|