Is this possible to do this in a theme?

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
5 .0
Description:

Is possible to do something like this,menus with rounded borders and the "snake" in a native style?
Where I can find some documentation for coding native style for kde 3.1?

WinterWolf

17 years ago

Personaly I don't need any extra snake effect to burn CPU cycles, it is already fine thew ay it works now in every OS except BE.

What I would really really like is rounded borders.

Report

rakko

17 years ago

And that wasn't used in any official release of BeOS, anyway.

Report

C

ra1n

17 years ago

Too bad that it seems to be VERY hard to do things like this, it would be very nice, there is 1thing I want to know, i saw in the dotNET style that the internal border is rounder, the internal border of a windows is so different from the menu?

Report

davidsansome

17 years ago

All the above people are wrong, except perhaps for benv57 - I'm not sure about that ;-)

This would be possible in a theme, and I don't think it would require any more redraws than the current styles. You'd need to apply a mask to the popup window each time the selection changed for the little snakey bit on the left. Then, you'd simply have some logic to draw the correct shape and outline. This would be pretty fast - certainly not visably slower than other styles.
The only problem I can think of is knowing where the previous submenu was. For example, if you bring up a popup menu towards the right edge of the screen, any other submenus open to the left of it. I'm not sure if it's possible for a theme to determine which side it was opened from.

Report

benv57

17 years ago

It's unfortunatly not possible due to a limitation in Qt style engine without a ugly hack as the shadow one... I've already tried things like that.
The problem is that the outer shape of a menu is a rectangle and cannot be changed. The only possible way is to take parts of the screen and redraw them on the menu.
You'll have to wait for trolltech to implement a menu mask...

Report

MDonoughe

17 years ago

Why can't you do like the shadow hack with a solid color instead of transperancy?

Report

upgrdman

17 years ago

why would it he hard to program that feature? i mean, im no programmer, but why would it be do difficult or time consuming?

--upgrdman

Report

Brandybuck

17 years ago

If you're not a programmer, it's hard to explain. Even if you're a programmer, but not a Qt/KDE programmer, it's hard. But I'll try.

What Qt will do when it needs to draw a menu is to first ask the style to draw the whole menu box as a blank panel. Then it will ask the style to draw each individual menu item. The actual menu items are not widgets, so the style will receive information on the item active/inactive state and the region in which it should be drawn.

One piece of information that Qt does NOT supply to the style is whether a menu item is before or after the active menu item. This is the big problem. When you are drawing an inactive menu item, you do not know whether you need to draw the vertical part of the snake or not.

Without delving into the Qt sources, the only way I can think to solve this problem would be to subclass the whole QPopupMenu class. But then only applications that used your new class would get this new functionality.

Report

davidsansome

17 years ago

Why not just draw the inactive items as normal, and then draw the entire blue bar along with the active one. Even if QT gives you a specific region to draw in, I'd assume you can go outside that by using a different QRect.

I might try this over the weekend :-)

Report

anonymous-hive

17 years ago

I can't tell you for a KDE/QT-style, but basically the problems are assumptions in the underlying layers:

- X11 assumes that every application wants (exactly) rectangular windows and provides exactly that. There is a way around that (the SHAPE extension) but it complicates things a bit.
- Toolkits (like Qt) often assume that their themes all want to provide (exactly) rectangular windows and model their API to represent that (I don't know if this is true for Qt, but I assume so, 'cause I've never seen a QT/KDE-Style that doesn't use rectangular windows).

I'd say the task at hand is possible, but quite hard ('though not "extremly hard, only the ones with m4d progr4mming skillz might try!").

Report

broeman

17 years ago

yeah, I think you are somewhat right ... I don't have (maybe a little) programming skills, but the menu need some kind of adaption. If a pointed windows is open, still keep overlay. If you again open a window on the next, create a overlay with direction ... well, I told you I wasn't a programmer :)

Report

SynTruth

17 years ago

I'm no C++ coder of any merit, but I can just imagine the number of redraws you would have to do to keep the 'snake' selection lined up as you moused-over each menu entry...

Well, I suppose it would depend on if KDE/QT only redraws the menu entry the mouse is over or if it redraws the whole menu. If it redraws the whole menu, then I think it could be done more easily -- but I can see where redrawing the whole menu would be a waste of CPU time...

Too bad native themes can't be done in pyQT, because then I might be able to do something. lol

Report

MDonoughe

17 years ago

Why can't the menus line up(like they do in the picture) and have a purple bar light up on the right edge to make the snake? It would only redraw that section like a menu highlight.

Report

boudewijn

17 years ago

Unless I am very much mistaken, it is quite possible to code native themes in PyQt. At least with PyQt for Qt 2 it was possible; I even devoted a chapter to it in my book on PyQt. The relevant base classes for Qt 3 are all implemented in PyQt, so I guess it's just a matter of giving it a try.

The real problem is, of course, that you can use those styles only from PyQt applications.

Report

nomar

17 years ago

Yes, but it would be insanely hard to do it. I don't think this is ever going to appear in anything other than BeOS, but then, if some person with "m4d programming skillz" gets *really* bored...

Report

redrat

17 years ago

Ad far as I know, it's screenshot from BeOS.

so long,
red

Report

karlandtanya

17 years ago

Did you gimp the screenshot after the fact, or did you set up your desktop to do this, then take a screenshot?

If the latter, what did you have to do to produce the effect?

Report

C

ra1n

17 years ago

Its BeOS

Report

12345678910
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
updated Mar 19 2003
added Mar 19 2003
downloads 24h
0
mediaviews 24h 0
pageviews 24h 2