My app looks so:
I want it to look so:
I.e. same background color, no border line between title bar and toolbar.
Yes, It seems I know how to do this using native toolbar (according to this). But I would prefer to avoid using native toolbars if it's possible. This toolbar is created by Qt QML code. It's cross-platform and is used on Windows/Mac/Linux.
Is it possible?
P.S. I'm not very much familiar with native macOS programming, so some code examples in C++ or Objective-C are highly appreciated.
Thanks to this answer I have found that NSFullSizeContentViewWindowMask + transparent title bar does the trick for me. I.e.
self.window?.titlebarAppearsTransparent = true
self.window?.styleMask |= NSFullSizeContentViewWindowMask
Related
I may need to change toolbar background, heading font and position.
Is it possible to do that with the standard CPToolbar? I was looking through the ThemeDescriptors.j, and there is nothing about a Toolbar.
It seams not so difficult to create my own. Should I go that way?
The toolbar isn't themeable as is (although, feel free to implement that for us. :) )
That said, you could do something like this depending on what exactly you want to do…
https://github.com/cappuccino/issues/blob/master/Client/AppController.j#L273
In XUL, how do you draw a menu (or any other content) where the title bar normally is?
This picture is NOT an XUL app, but it illustrates what I'm trying to accomplish:
Notice how the menu at the top is in-line with the min/max/close buttons.
In the Mozilla developer reference, I see that there is a drawintitlebar attribute for the <window> element. However, setting this to 'true' doesn't change anything that I can see.
Thanks!
The answer is essentially the same as in this question - there is no easy way. You cannot just put something into the title bar, you have to replace the OS-provided title bar by your own. So you use chromemargin="0,-1,-1,-1" attribute to remove the usual title bar and you put <xul:titlebar> as the first element of your window. It should contain the usual minimize/maximize/close buttons (these will look correctly if you use the right -moz-appearance styles). Then you will be able to put a menu into the <xul:titlebar> element. But you will need lots of code and styles to ensure that your windows look like native windows on all operating systems.
In GTK+ I would like to have a vertical list of labels, that a user can scroll. A user can click on any label and it will go to it's own callback function.
Right now I'm using a vertical area of buttons, but I really do not like having buttons. To give a good example, what I am trying to achieve would be considered very similar to a ListView in Android:
Is it possible to achieve this? I have tried replacing my buttons with labels but the signals stopped working (which would make sense). The GtkList is depecrated, and I am not sure what I am supposed to use instead?
I think you can use GtkTreeView with GtkListStore ( GtkTreeSelection for selection in GtkTreeView ). For scrolling of course you will make use of GtkScrolledWindow. Using GtkTreeView can be a little intimidating for a beginner but there are quite a few tutorial available online like this one. Also, if you can install gtk-demo application (part of gtk2.0-examples package on Ubuntu) which demonstrates using Gtk widgets along with code, it will be quite helpful for you.
Hope this helps!
What you could do as well (if you really want to use labels) is to just put each of them into a GTKEventBox, and then set the event mask to receive mouse clicks.
EDIT:
Example:
GtkWidget* gtk_clickable_label_new(const gchar *str)
{
GtkWidget *eventbox, *label;
label = gtk_label_new(str);
gtk_widget_show(label);
eventbox = gtk_event_box_new();
gtk_widget_add_events(eventbox, GDK_BUTTON_PRESS_MASK);
gtk_container_add(GTK_CONTAINER(eventbox), label);
return eventbox;
}
Have you tried putting your labels in a GtkVBox in a GtkScrolledWindow?
I think what you want is a bunch of GtkButtons that have no hieght/depth.
To do this use gtk_button_set_relief and choose the GTKReliefStyle of GTK_RELIEF_NONE.
That's how I put buttons in GtkTreeViewColumn headers, it looks nice.
Try it!
I want to create an on-screen display, i.e. text or simple graphics that appear on top of everything else being displayed. I know in Linux this is achieved with xosd, but how do you do it in Windows? (Assume XP and up if it makes it easier, and I would also be interested in knowing if the method is different in Vista/7)
You can use NativeWindow to do this as described here.
The article explains how to create an
OSD window with
animation/semi-transparent effects, in
C#, using the NativeWindow class.
Use the WS_EX_LAYERED style to make the window transparent, and SetWindowPos(..., HWND_TOPMOST, ...) to make it float above other windows.
You can call SetForeGroundWindow
Guys any one can please help me in doing this -> I need to place a progress bar (QProgressbar) in a QSplashScreen . How can i do this in design?..can i really implement it?
Using pyqt3
From the Qt docs of Qt4.4:
If you wish to do your own drawing you
can get a pointer to the pixmap used
in the splash screen with pixmap().
Alternatively, you can subclass
QSplashScreen and reimplement
drawContents().
I suppose this would also work in Qt 3 (or PyQt3); just subclass QSplashScreen and re-implement drawContents() by putting a progress bar on it, and extending the interface with some progress methods.
If you look at the changes between Qt3 and Qt4 you can see how the Trolltech people did that (albeit in C++).