Access system icons with NodeJS - linux

I'm developing a HTML5 app with node-webkit.
I want my application to follow the icon theme of the host computer that runs it (primarly Linux hosts).
Frameworks such as GTK+ or QT successfully find the corresponding icon of a standard stock (such as NEW_FILE) based on the user's theme.
GTK icons theme are installed at $HOME/.icons or /usr/share/icons and icons theme share a common directory structure.
But is it any rule or algorithm to get an exact icon?
How can I look up a (NEW_FILE, SAVE_FILE or whatever) stock icon within the users theme?
I'm quite lost with this.

You could look in the source code for GTK+ or QT and see how they determine the right icons?

Related

Display pdf document in flutter windows

I have been finding it difficult to display a pdf on flutter windows and other desktop applications. Can someone help me out
This is the same as this question, but for Windows, so the answer is the same at a high level. As with Linux, PlatformView is not yet supported for Windows.
Two options that could work without PlatformView support:
Swap the window between displaying the Flutter view and a PDF view (if you want the PDF to fill the window while displayed).
Place the Flutter view and the PDF view side by side in the window (if you want both Flutter content and PDF content visible at the same time).
Both would require the work to be done in the native code, so you would need to either write a plugin, or implement it directly in your runner, and use a method channel to coordinate between Dart and native code.

Embed images in Vala project for later use in UI

Context
I'm new to Vala development (although I have some years of experience with C#) under Linux, and I decided to recreate one of my C# programs, however, I need to use images in the UI.
My problem
How can I embed resource files (such as images) for later use in the UI? How to access them later? And how to put them in a button?
What I'm using
I'm using Linux (Mint) and Anjuta development IDE, with the Glade UI designer integrated. The Vala project targets a GTK+ 3.0 project.
What I've tried
I have tried adding a new specific objective for images, adding them into the project... But I don't seem to succeed.
I have seen the default images provided by Linux, and those work just fine, but I need to add my own.
Thanks in advance!
The normal approach would be to install your images to PREFIX/share/pixmaps/YOUR_APP. For example Gnumeric installs some .png files in /usr/share/pixmaps/gnumeric/.
You can use GResource to embed binary files (like images) into your executable if you really want to. The glib-compile-resources command can be added to your build system (see also this question).
You can also use icons from the users icon theme.
You didn't write what component you want to use to display your images, so I'll assume Gtk.Image here.
Gtk.Image has several constructors for the purpose of loading the image:
from_icon_name loads the image from the current icon theme (which is useful to support user themes).
from_resource loads the image from an embedded GResource.
from_file loads the image from a file.
See the main documentation of Gtk.Image for more methods. Some other widgets have similar methods to load images (for example toolbar buttons).
You should not use from_stock any more (There was a stock system in Gtk+ that is being replaced by freedesktop.org icon schemas).

Desktop gadet/app for Windows

I want to make a desktop gadget like the Sticky notes that we have but just with some additional functionality.
Now that the gadgets have been discontinued in windows, i am not sure about what technology to use to create this app.
I want to create a custom UI like just a Add button on the side of the desktop and clicking on it would create notes.
I was trying to use node-webkit but seems that will appear like a web page and not what I want. Can anyone tell me what should i use to achieve the result.
A Node Webkit window doesn't have to look like a webpage. You can use a frameless window and then design the UI to look however you want with HTML and CSS.
Frameless Window

'How do you want to open' 8.1 dialog and icons

Does anyone know, where Win 8.1 gets the icons, used in the dialog, from?
In my case an app icon is corrupted (instead of mine, another app icon is used for my app), and I want to debug the issue. But for that I have to know, where is a source of the icons.
I've already inspected my .exe file resources, there is no other icons there but mine.
It turns out, that when an app is registering itself as matching some user's model, it should set the logo and background color. See AppUserModelId (http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx) for details.

How to separately style HTML5 apps using the Sencha framework for iOS and Android?

App development in native Apps happens separately for iPhone and Android. But in HTML5 Sencha framework apps, the same HTML5 code is used. Should we use same visual styling for alert boxes or buttons for both platforms or should they look different depending on the platform?
Since the same HTML5 code is used, how do you to take care of different look and feel for both platforms? For example, the menu bar is at bottom for iPhone and for android it is at the top. Or for Android we need to hide the top back button Or how to style the alert boxes or buttons differently for both platforms?
Do we need to use different set of CSS files for iOS and for An?
I was going thru the kitchen sync Sencha application and it shows a very basic styling for alert boxes.
You can use the iOS/Android classes that Sencha Touch will add when detecting user agent. For example, if the device is running iOS the body element has the class "x-ios". For android it will be "x-android". This also applies for specific OS versions (ex: "x-ios-4"). Try overriding your user agent in Chrome and inspect the elements under different agents to get an understanding of the classes. Using these classes you can avoid multiple stylesheets and just set up the CSS accordingly depending on the class.
As for specific layout tweaks that cannot be performed with simple CSS - this is where profiles come into play (http://docs.sencha.com/touch/2-1/#!/api/Ext.app.Profile). Set up a profile for Android and iOS, and use the launch function to manipulate specific components as needed.
Using these methods you should be able to keep things organized and minimize the number of separate files needed.

Resources