Thread: [Fremantle Maemo5] [Announce] Character Map for Maemo
View Single Post
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#15
Originally Posted by pichlo View Post
I have been experimenting with that and must say it can be made to work pretty well, but at the cost of losing the buttons. I see little point switching to Qt to get the exact same look as I do with the GTK version, so I may as well stick with GTK. The GTK binary is also about half the size, works faster and has fewer dependencies.
Well, I suspect that part of the reason why the GTK version is able to handle so many characters is that it isn't using full-fledged buttons. I haven't coded in GTK in a while; I know that the selling point of GTK (as opposed to Qt) is that it is more efficient -- but still, I would imagine that turning each character into a real GTK button would eventually lead to the same problems as with real Qt buttons.

(It seems that you can, in fact, insert Qt buttons into a Qt list, but that would probably have the same result as just putting the buttons into a layout widget...)

One thing you can do with Qt, though, is use stylesheets! (Something that I'm slowly learning myself.) So, if you want to make the Qt list items look and act like buttons, something like this might work:

Code:
QListView::item{
  background:qlineargradient(
     spread:pad, x1:0, y1:0, x2:0, y2:1,
     stop:0 rgba(80, 80, 80, 255),
     stop:0.8 rgba(80, 80, 80, 255),
     stop:1 rgba(48, 48, 48, 255));
  border-width: 1px;
  border-style: solid;
  border-radius: 12px;
  border-color:rgba(80,80,80,255);
}

QListView::item:selected{
  background:qlineargradient(
    spread:pad, x1:0, y1:0, x2:0, y2:1,
    stop:0 rgba(128, 128, 128, 255),
    stop:0.8 rgba(128, 128, 128, 255),
    stop:1 rgba(48,48,48,255));
}
The downside of this, though, is that Qt stylesheets are apparently incompatible with Maemo theming...
 

The Following 3 Users Say Thank You to Copernicus For This Useful Post: