Styling Xfce Applications Menu with gtkrc - xfce

I'm a bit stumped. I'm using Xfce 4.10.1 in Xubuntu 14.04. The old Applications Menu is better for my workflow than the new Whisker Menu but I'm having trouble increasing the icon size in it from the default 16px to 24px.
In Xfce 4.10.0, I simply had to add a line to HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml. According to Xfce Docs, that function is now taken over by the gtkrc theme file:
XfceApplicationsMenuPlugin
-----------------------------
You can set a custom icon size in gtk-icon-sizes with the name
panel-applications-menu. The default icon size is 16px.
Special widget name in this plugin is applicationmenu-button.
Source of the above here: https://github.com/EasternHeart/heartlenv-shell/blob/master/docs/README.gtkrc-2.0
There's no example there so I have tried variants of the following with no success:
style "panel-applications-menu"
{
gtk-icon-sizes = "panel-applications-menu = 24,24"
}
class "XfceApplicationsMenuPlugin" style "panel-applications-menu"
widget "applicationmenu-button" style "panel-applications-menu"
I've also tried adding the above to &Home/.gtkrc-2.0 without success.
Does anyone have any idea what I'm doing wrong?

I'm running xfce 4.12 but this might work on 4.10 too.
Try copying a theme (eg. Bluebird) from /usr/share/themes/Bluebird to ~/.themes/Bluebird-custom then edit ~/.themes/Bluebird-custom/gtk-2.0/gtkrc
The code order is important, so add this at the very end
style "applicationsmenu" {
xthickness = 0
ythickness = 0
}
widget "*applicationsmenu*" style "applicationsmenu"
I got the widget name (applicationsmenu) by right-clicking the panel then going panel > panel preferences > items and hovering the mouse over an item to display a tooltip with its "internal name".

Related

WIN32: Duplicate Standard Button Control (disabled Icon / hotkey underline) in Owner Draw Button?

So for the simple feat of wanting to put an icon on the right side of button text instead of the left resulted in having to use owner draw buttons (but someone here said Custom Draw is actually available if using visual themes). Okay, fine, but now I'm finding you can't really duplicate what Windows standard buttons do when it's not in owner draw mode.
For a normal enabled button I can get the look correct by checking if visual styles are available or not and then using either the DrawThemeBackground() / DrawThemeText() or DrawFrameControl() / DrawText(). However the hot key underline character is shown even when alt key is not pressed, the default buttons don't show it until alt pressed.
For a disabled button, I can't duplicate the disabled look of the icon placed on the button. I tried DrawState() over DrawIconEx() but that looks like the old Windows 3.1 type grey graphic not the visual style dimmed graphic. I see there is a DrawThemeIcon() for an image list, I guess I could try that (I'd have to test non visual style mode to see if DrawState() matches when not using visual styles).
Also, as you hover over the button, the state doesn't change, I understand that if using owner draw, that doesn't occur, maybe it would still work with Custom Draw?
So the two main questions are:
1 - Is there something built-in to the button / owner draw to handle the underlined hotkey only when alt was pressed?
Update to Question 1: I found DT_HIDEPREFIX in DrawText() and using Custom Draw there is the CDIS_SHOWKEYBOARDCUES flag. However with Owner Draw I'm not sure if there is a flag someplace?
2 - How do you draw an icon for a button that is disabled to match what default buttons do?
TIA!!
For shortcut underline you can use WM_QUERYUISTATE to ask if it should be hidden or visible
DWORD draw_text_flags = ...;
if ( SendMessage( control_hwnd, WM_QUERYUISTATE, 0, 0 ) & UISF_HIDEACCEL ) != 0 )
{
// hide prefix
draw_text_flags |= DT_HIDEPREFIX;
}
// some combination of PBS_DEFAULTED, PBS_DISABLED, PBS_HOT, PBS_NORMAL, PBS_PRESSED;
int state = ...;
DrawThemeText( theme, hdc, BP_PUSHBUTTON, state, text, text_len, draw_text_flags, 0, rect );
Answer to Q2: If you create an HIMAGELIST using ILC_COLOR32 | ILC_MASK, and use ILD_NORMAL|ILD_BLEND25 on ImageList_Draw() it gives the same look as windows default buttons for a disabled button.
Based on responses from #Remy-Lebeau and #Daniel-Sęk and reviewing various projects on CodeProject, I create an easy to use class to handle this. It can be found at CodeProject. Thanks Guys.

MadCap Flare Style ID menu enlarged and not working

I'm fairly new to using Madcap Flare but have been using it without problems for a few months. Now suddenly the Style Class menu appears zoomed way out to many times its normal size, and it won't scroll or let me select a style. The steps to reproduce the problem:
Open an .htm topic in MadCap Flare 12.
In the XML Editor view, right-click on a P tag.
From the pop up menu, select Style Class > and wait.
After a few seconds, the style class menu pops up on the left but it's covering three-quarters of the screen from left to right, and covering the entire screen from top to bottom. The style items in the menu are so huge that only four of them are visible. I can't scroll through them nor select one.
Until recently the menu acted normally, popping up in a much smaller size and letting me scroll through it and select styles.
I haven't found any mention of this in my searches online.
Edit: Adding a few more pieces of info:
Resetting MadCap Flare layouts doesn't help.
This only happens on paragraph tags, I notice. If I right click on a li or h2 or any other kind, the style class menu acts normally.
The styles in the class menu come from a CSS file that might be corrupt or contain invalid syntax that Flare is parsing incorrectly.
Locate the CSS file (Default location within Flare: Content Explorer > Resources > Stylesheets > Styles.css).
Right-click the file and select Open with > NOTEPAD.EXE.
Copy the contents of the CSS file and validate it here: http://jigsaw.w3.org/css-validator/#validate_by_input
Fix the validation errors, then copy the results back into the CSS file and save you changes.
This seems to have been just a matter of the WYSIWIG popup styles menu expanding to display the one heading that the previous writer had set up to a large font size. In displaying the one heading style at 96 pt, Flare increases the height of all of the style menu entries to that height, which unfortunately makes the menu pretty much unusable.
The solution was just to use the other ways of accessing the styles, displaying the styles window for example which doesn't seem to have this problem, and avoiding using the popup styles feature.
I went through everything else, validating the CSS file and etc, before finding the solution or at least the workaround.

Firefox: Page Background Color *before it starts loading*

"browser.display.background_color" sets the background color of some pages (blank etc.).
However, If you open a link in a new tab - the color of the new page before it starts loading is not affected by that setting.
Set "browser.tabs.loadInBackground" to false and override New Tab to "about:blank".
Now open a link in a new tab.
I'd like to change that and I'd be glad if you could refer me to the relevant code in the source files.
Thank you.
http://forums.mozillazine.org/viewtopic.php?f=19&t=2987189
The relevant code is in chrome\browser\content\browser\tabbrowser.css.
.tabbrowser-tabbox {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tabbox");
/*
background: Menu;
color: MenuText;
*/
}
Regards.
By setting browser.display.use_system_colors to false in about:config, it uses the color of the Firefox theme on that brief interval before start loading a page. If the theme is dark, it will suffice to remove the white flash background if that is specifically what you want.

Why does the skin not work to button when using 5.5 plugin?

I am using Kony 5.5 plugin then took build for BBQ10. I declared red colour for the button in the skin. But the colour has not applied to the button means black colour button displayed instead of red colour button in the Q 10 device. I want to change the colour of the button. Please give me solution.
A couple of things to check:
1. make sure that under the Skins for the button widget, there is not a forked setting for BB; you may have changed the "Common" skin, but if there is a declared skin specifically for BB, then it will override your settings.
2. Try adding a new button just to test, specifically set the color to red, and see if that button is displaying properly. This will show if there is an overall issue or just an issue with the button you are trying to configure ( this is more of a sanity check than a technical fix )
Customized skin using colour doesn't work to Blackberry 10 devices.It is a limitation of Kony platform.Please read documents the following link.
Docs
First you have to check whether you choose skin option for button then check its under common. Because you may choose on Windows, iOS or other. Try this:
//Defining the properties for a button with skin: "btnSkin".
var btnBasic = {
id:"button1", isVisible:true, skin:"btnSkin",
focusSkin:"btnFSkin", text:"Click Here"
};
var btnLayout = {
containerWeight:100, padding:[5,5,5,5],
margin:[5,5,5,5], hExpand:true, vExpand:false,
displayText:true
};
var btnPSP={};
//Creating the button.
var button1 = new kony.ui.Button(btnBasic, btnLayout, btnPSP);
//Reading skin of the button.
alert("Button skin ::"+button1.skin);

Change the colour of WinJS.UI.BackButton (Win 8.1 back button)

I'm getting started with Windows 8 App development using WinJS. I'm using the Light UI theme but I have set up a darker area on the left of the page (where the black back button is) and the issue is: you can't see the button.
I've trawled through the MSDN pages and the most I could find is how to style a button which doesn't actually explain how to change the colour of an actual asset.
http://msdn.microsoft.com/en-us/library/windows/apps/jj835822.aspx
I've also tried adding: win-ui-light and win-ui-dark classes to the button with no success.
I wondered if someone could point me in the right direction?
Many thanks for your time
Chris
First of all you have to delete the link tag that contain UI css by default and add it to document head , Dynamically.see below code :
var uistyle;
// call when your app load or resume.
function onappopen(){
uistyle = document.createElement('link');
uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";
uistyle.rel = "stylesheet";
uistyle.id = "UIstyle";
document.head.appendChild(uistyle);}
// call when you want to change UI Style.
function UIstyle(UIbool){
if(UIbool=='light'){ uistyle.href = "//Microsoft.WinJS.2.0/css/ui-light.css";}
else {uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";}}
Like: UIstyle('light'); for light UI in Windows 8 or "UIstyle()" for dark;
I used the DOM Explorer to find the buttons default values and overwrite them. It was the child element that needed to be overwritten: .win-back

Resources