-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: alex-z <[email protected]>
- Loading branch information
1 parent
39eab0b
commit 4101abf
Showing
8 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) 2023 by Oleksandr Zolotov <[email protected]> | ||
* | ||
* 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. | ||
*/ | ||
|
||
import QtQuick 2.15 | ||
import Style 1.0 | ||
|
||
Item { | ||
id: root | ||
|
||
property alias source: icon.source | ||
property alias sourceSize: icon.sourceSize | ||
property alias backgroundIconSource: backgroundImage.source | ||
|
||
implicitWidth: backgroundImage.source !== "" ? backgroundImage.implicitWidth : icon.implicitWidth | ||
implicitHeight: backgroundImage.source !== "" ? backgroundImage.implicitHeight : icon.implicitHeight | ||
|
||
Image { | ||
id: backgroundImage | ||
|
||
anchors.fill: parent | ||
|
||
cache: true | ||
mipmap: true | ||
|
||
sourceSize { | ||
width: root.width | ||
height: root.height | ||
} | ||
|
||
fillMode: Image.PreserveAspectFit | ||
visible: source !== "" | ||
} | ||
|
||
Image { | ||
id: icon | ||
|
||
anchors.centerIn: parent | ||
|
||
cache: true | ||
mipmap: true | ||
|
||
fillMode: Image.PreserveAspectFit | ||
visible: source !== "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.