How to load XPM into XWMHints icon_pixmap property? - icons

Is there a simple ready solution to just #include <icon.xpm> and get it as your app icon?

See example code answers to this question - you need to upload rgba data to server-side pixmap and assign _NET_WM_ICON value to pixmap id.
Unfortunately this won't work for ubuntu/unity - there you set icon in the desktop file and associate your window with desktop file using by setting _NET_WM_DESKTOP_FILE property ( see my related answer )

Related

Construct3 Splash Screen For HTML5

How to change default splash screen in construct3 HTML5.
which show like
and also in console.log it show bellow message
"Made with Construct 3, the game and app creator :: https://www.construct.net"
how to remove it
First, you need a license.
Second, select your project root folder (on right, called Box Size for my project).
Lastly, select Loader Style and update as you'd like
The splash screen is hidden in the c3runtime.js file after you export your game in the form of base 64 strings.
I made a tool to replace the images and colors but to my knowledge only works for Construct 2.

Unable to add an image in the storyboard editor in Visual Studio to create a splash screen for Xamarin.iOS

I'm trying to add a splash screen to an iOS app built using Xamarin.Forms. I'm able to get the splash screen itself to display, but I'm unable to add an image to an ImageView in the storyboard editor.
I can replicate this behavior in a brand-new "Cross Platform" solution, and I'm following the instructions here. Specifically, at step 10 in the instructions, you're supposed to be able to select the image from a dropdown.
If you actually click on the arrow of what only appears to be a dropdown, however, nothing actually "drops down"; instead VS opens an OpenFileDialog entitled "Add Existing Item".
No matter what file I choose, VS only adds it to the project's Resource folder (as a BundleResource), but doesn't change the image in the storyboard at all.
I've tried adding the images to the Asset Catalog as both a Launch Image and a regular Image Set. I've tried typing either a filename or an asset set name into the editable part of the "dropdown"; no luck. I've also tried editing the storyboard XML to add an image= attribute (to the ImageView tag), again using either a filename or an asset set name, but it doesn't work, and subsequent saves from the storyboard editor actually remove the attribute. I also tried explicitly adding the entire "Assets.xcassets" folder to the project, as suggested by one of the answers here.
FWIW, the property labeled "Highlighted", directly under "Image", also has the same behavior. I'm assuming this is a VS bug of some sort; the behavior of the property is different not only from what's described in the docs, but conflicts with the appearance of the control.
Has anyone come across a workaround?
Windows 10 Pro
VS 2017 15.8.3
Xamarin 4.11.0.756
Xamarin Designer 4.14.221
Xamarin.iOS and Xamarin.Mac SDK 11.14.0.13
It is bug, you can voite to this problem https://developercommunity.visualstudio.com/content/problem/319294/xamarinios-cant-select-image-asset-for-image-view.html

GTK+3 C gtk_label_set_use_markup for a GtkButton + CSS style

I'm porting a GTK+2 based application to GTK+3 on Ubuntu 16. I'm trying to set the markup for the label of a button but it seems something has been deprecated. Here is the original code:
gtk_label_set_use_markup(GTK_LABEL(GTK_BIN(button)->child), TRUE);
GCC now complains that GTK_BIN doesn't have a member 'child'. So is there another technique I can use to do this? I've really struggled to find any useful information on this.
Related to this...I'm also looking for a WORKING example of using CSS to setup widget styles for a GTK+3 app. The current app uses gtk_widget_override_background_color() which is now deprecated. It seems the only way to control color is with CSS but I can't seem to glue the pieces together yet. I need to setup different colors for different widgets.
After some searching and experimentation found a solution to part of the problem. This works to set the markup of a button label as long as the label is the only child of the button widget:
gtk_label_set_use_markup(GTK_LABEL( gtk_bin_get_child( GTK_BIN(button) ) ), TRUE);
I still have not found a way to dynamically control the background color of a label or button widget using styles.

Display decoration in ListView delegate

I have a C++ model that is used in QML. It's working fine, but I have problems showing decoration. How can I display icons in QML? I have searched the documentation and the web, no success. Image doesn't work either.
You have two options:
provide the icon as a string with a path to the icon file and use an Image element in QML to load the icon from the path string.
provide the icon as a QImage and use a custom image provider to use the QImage as a source for a QML Image.
The second approach is overkill in your case, but still, image interop between C++ and QML is possible if you need it in future.

Show standard warning icon in Qt4

I'm trying to display a "warning" icon next to a QLineEdit if it contains invalid data. I was trying to use QStyle::standardIcon(QStyle::SP_MessageBoxWarning) to get a standard pixmap and place it inside a QLabel, and in some cases this seems to work. When running Gnome the icon is displayed correctly, but when running under KDE no icon is shown. I assume that the warning icon is simply not included in the style used under KDE.
What is the preferred way to display a "standard" warning icon in Qt? Does there exist some list which shows which icons are included in every style? How can I get an icon from a style that I know includes the warning icon?
The last time I had a similar problem, I found this Qt labs discussion useful. It informed me that QIcon now (since 4.6 I believe) has a QIcon::fromTheme function that allows you to load an icon based on the Freedesktop.org Icon Naming Specification, and in addition provide a fallback icon to be used if the current theme does not have the icon in question.
What I did was then to include some very basic icons for use as fallback, and in general specify icons only by their Freedesktop names. This gave a theme-consistent look almost always, and the program still worked in cases where people were missing icons.
As for the warning icon, I'm guessing/hoping that every theme must have the one named "dialog-warning", and that it's what you're looking for.
I hope this helps.
Edit: Oh and, in case you don't know, it can be useful to look at for example the Tango icon set to get a rough idea of what the Freedesktop names correspond to (although it is of course theme-dependent).
Qt does bundle a number of images that are resources that you can use in your own code. These images are a superset of those available via standardIcon() You may want to verify that the particular image is included in the versions of Qt you're targeting.
The end result could look like the following:
QPixmap pixmap(":/trolltech/styles/commonstyle/images/up-128.png");
// use pixmap as needed
For anyone who wants to know how to do this in a Windows environment you can:
Create a qLabel in your custom class, and then in the constructor of that class create a QIcon with the style you want, convert it into a pixmap and use the QLabel::setPixmap() function to apply it to the one you created:
QIcon icon = style()->standardIcon(QStyle::SP_MessageBoxWarning); //or
//whatever icon you choose
QPixmap pixmap = icon.pixmap(QSize(60, 60));
ui->iconLabel->setPixmap(pixmap);
ui->iconLabel->setScaledContents(true); //you can set this to fill the
//dimensions of your qLabel if you wish.

Resources