aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-01-11 09:22:40 -0500
committerKen Moore <ken@ixsystems.com>2018-01-11 09:22:40 -0500
commitbbabaada12e6d7e355c396961fe180e8e5b2b911 (patch)
treea7b2fb758ed94ba8e8f31666685bcb2c03477599 /src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp
parentGet the window compositing/painting routine finished up with a seamless image... (diff)
downloadlumina-bbabaada12e6d7e355c396961fe180e8e5b2b911.tar.gz
lumina-bbabaada12e6d7e355c396961fe180e8e5b2b911.tar.bz2
lumina-bbabaada12e6d7e355c396961fe180e8e5b2b911.zip
Get a lot more of the Native Window embed routine up and running. Actually usable now.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp
index 0899337c..3f595245 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/QMLImageProvider.cpp
@@ -27,14 +27,25 @@ QImage QMLImageProvider::requestImage(const QString &id, QSize *size, const QSiz
QImage img(requestedSize,QImage::Format_RGB32);
if(win==0){ img.fill("black"); } //invalid window ID (should never happen)
else if(id.startsWith("image:")){ img = Lumina::NWS->GetWindowImage(win); }
+ else if(id.startsWith("icon:")){
+ QIcon ico = win->property(NativeWindowObject::Icon).value<QIcon>();
+ QList<QSize> sizes = ico.availableSizes();
+ QSize sz(0,0);
+ //Just grab the largest size currently available
+ for(int i=0; i<sizes.length(); i++){
+ if(sz.width()<sizes[i].width() && sz.height()<sizes[i].height()){ sz = sizes[i]; }
+ }
+ qDebug() << "Icon Sizes:" <<sizes;
+ img = ico.pixmap(sz).toImage();
+ }
//else if(id.startsWith("icon:")){ img = Lumina::NWS->GetWindowIcon(win); }
- qDebug() << "Got Window Image:" << img.size();
+ //qDebug() << "Got Window Image:" << img.size();
if(img.size().isNull()){
if(requestedSize.isValid()){ img = QImage(requestedSize,QImage::Format_RGB32); }
else{ img = QImage(QSize(64,64), QImage::Format_RGB32); }
img.fill("black");
}
- qDebug() << "Final Window Image:" << img.size();
+ //qDebug() << "Final Window Image:" << img.size();
if(size!=0){
size->setHeight(img.height());
size->setWidth( img.width() );
bgstack15