From bug 84579 comment 15: 'the current hint "Font Color" would be completed in future by "Font Color (automatic)", "Font Color (Chartreuse)" or "Font Color (#7f9101)", depending on the actual color.'
After your brilliant work on bug 60937 how about this ticket, Abhishek? Currently we have a tooltip "Font Color" or "Highlight Color" when hovering over the toolbar or sidebar button and it would be nice to also get the actual color of the selected object. The color widget is defined in svx/uiconfig/ui/colorwindow.ui and svx/source/tbxctrls/tbcontrl.cxx. The color of the current object is a bit more difficult, ask if you need help.
Heiko, thanks! Currently I am in middle of bug 112373, which I think will be done by today. I definitely want to work on this next. I am assigning this to myself! I will bug you on IRC when I start facing issues on fixing this :D
Hi, I am facing an error probably related to glade. I copied the Libreoffice catalog from libreoffice/extras/source/glade/libreoffice-catalog.xml , to another folder and added the environment variable "GLADE_CATALOG_SEARCH_PATH" pointing to this folder. But on loading the svx/uiconfig/ui/colorwindow.ui , I get errors in glade, Here is the log - https://pastebin.com/SB7g2w7N Do I need to have gtk libraries installed too for working on the UI related issues ?
(In reply to abstatic from comment #3) > Hi, > > I am facing an error probably related to glade. I copied the Libreoffice > catalog from libreoffice/extras/source/glade/libreoffice-catalog.xml , to > another folder and added the environment variable > "GLADE_CATALOG_SEARCH_PATH" pointing to this folder. > > But on loading the svx/uiconfig/ui/colorwindow.ui , I get errors in glade, > > Here is the log - https://pastebin.com/SB7g2w7N > > Do I need to have gtk libraries installed too for working on the UI related > issues ? Not sure on what libs are required but your catalog reference is not working. Just add the right reference under Edit > Preferences (it's ~/Sources/libreoffice/instdir/share/glade in my case; I never copy/move this file to another place).
I can't get glade to work on my machine. Unassigning myself.
(In reply to abstatic from comment #5) > I can't get glade to work on my machine. Unassigning myself. That's a pity. But do you need Glade at all? I mean to dynamically modify a tooltip is rather a question of C++, right?
Created attachment 139293 [details] Proposed image
Comment on attachment 139293 [details] Proposed image Did you mean to extend the tooltip to something like this? Where the currently selected color shows up in the side of "Font Color"
(In reply to abstatic from comment #8) > Did you mean to extend the tooltip to something like this? Where the > currently selected color shows up in the side of "Font Color" No this isnt what is wanted. What is wanted is the changing of just the button tooltip from 'Font Color' to 'Font Color (Red)' if Red is the last selected color from the color picker widget. If the color doesnt have a name from the palette, it would show the hex of the color like so, 'Font Color (#7f9101)".
(In reply to abstatic from comment #5) > I can't get glade to work on my machine. Unassigning myself. Tested Glade on macOS and install per homebrew is as easy as on Linux. But I did succeed on Windows. Binary installer works but when I try to add the catalog the program crashes. The wiki has a few infos but I suggest a virtual environment if your trouble is caused by the OS. https://wiki.documentfoundation.org/Development/BuildingOnWindows#Running_Glade_on_Windows
I was able to run glade on Ubuntu, seems after all it was a distro issue (arch linux). Status update- Currently I am going through SVX, VCL and how UI works on LO.
I was able to figure how to get current color, but how do I update the color tooltip? I tried this->SetQuickHelpText() , but it didn't update the correct tooltip, i.e. of the button. I also found out the .xcp file and the slot ids which are used. But I can't figure out how to programmatically update the tooltip whenever the color is changed. Can I get some hints?
I was also able to programmatically change the tooltip text using SetQuickHelpText() method, but I was able to do that using toolbar update (tbxcolorupdate.cxx) file and adding an if condition, if the slotid of the toolbar update is SID_ATTR_CHAR_COLOR or SID_ATTR_CHAR_COLOR2 then update the tooltip as well. This seems like an inefficient way to do it. I am trying to figure a better approach to update the tooltips directly from the SvxColorWindow object in tbcontrol.cxx
abstatic: would suggest you check with Samuel on irc if you can catch him or maybe Maxim can give you a suggestion.
(Replying to question on IRC) Colors are translatable with RID_SVXSTR_COLOR_* linked to static const char* SvxUnoColorNameDefResId[] in svx/source/unodraw/unoprov.cxx. Functions SvxUnogetApiNameForItem() and SvxUnogetInternalNameForItem() in the same file look promising.
In... IMPL_LINK(SvxColorToolBoxControl, SelectedHdl, const NamedColor&, rColor, void) in svx/source/tbxctrls/tbcontrl.cxx rColor.second is/(should be I think) the name of the color in the palette when it is selected by the user
I have posted a patch regarding this, please review. https://gerrit.libreoffice.org/#/c/49713/
I have added a translatable strings to get the color names and text (int strings.hrc file), as follows in IMPL_LINK(SvxColorToolBoxControl, SelectedHdl, const NamedColor&, rColor, void) in svx/source/tbxctrls/tbcontrl.cxx- OUString colorHelpText; if (m_nSlotId == SID_ATTR_CHAR_COLOR || m_nSlotId == SID_ATTR_CHAR_COLOR2) colorHelpText = SvxResId(RID_SVXSTR_CHARCOLOR) + rColor.second; else colorHelpText = SvxResId(RID_SVXSTR_CHARBACKCOLOR) + rColor.second; But I can't figure out how to add the initial color names (the dark red for font color and the yellow highlight color) I also think it would be really great if we could update the font color and highlight color icons based on current focus in the text (this happens in google docs) , which would provide a more concrete feedback on what color is currently active. For this I figured out it might work by adding some code in SvxColorToolBoxControl::statusChanged( const css::frame::FeatureStateEvent& rEvent ) method as its the one that gets called up every time color change happens, but how do I get the current color? Not the last selected color, but the one which is currently active. And how to figure out the color name in statusChanged method? One way to do this could be to iterate over the palette?
(In reply to abstatic from comment #18) > I have added a translatable strings to get the color names and text (int > strings.hrc file), as follows in IMPL_LINK(SvxColorToolBoxControl, > SelectedHdl, const NamedColor&, rColor, void) in > svx/source/tbxctrls/tbcontrl.cxx- > > OUString colorHelpText; > if (m_nSlotId == SID_ATTR_CHAR_COLOR || m_nSlotId == SID_ATTR_CHAR_COLOR2) > colorHelpText = SvxResId(RID_SVXSTR_CHARCOLOR) + rColor.second; > else > colorHelpText = SvxResId(RID_SVXSTR_CHARBACKCOLOR) + rColor.second; FYI You can just get the string from officecfg/ like this: vcl::CommandInfoProvider::GetLabelForCommand( m_aCommandURL, m_sModuleName ) so hopefully we could avoid adding more translatable strings. > I also think it would be really great if we could update the font color and > highlight color icons based on current focus in the text (this happens in > google docs) , which would provide a more concrete feedback on what color is > currently active. Please don't. Our toolbar color buttons (unlike google docs) are split buttons, i.e. they have a main part which applies the last color, and a dropdown part which opens the color picker. Having the button show the color of the currently selected text will make it non-obvious which color will be applied when clicking the main part. (Besides, showing the selected color on the button isn't as useful as a tooltip, as the user can just look at the text itself.)
(In reply to Maxim Monastirsky from comment #19) > ... Having the button show the color > of the currently selected text will make it non-obvious which color will be > applied when clicking the main part. Good point.
> Uploaded patch set 2. I am using translatable strings now. So the everytime the color changes its visible to the user. But I can't figure out how to add the color name suffix right at the start, when the color is set to default/automatic. Right now it only shows "Font Color" For setting the initial help text along with the color name, I tried adding the code to SvxColorToolBoxControl::initialize using "GetAutoColor()" method but it returned the color name as "Automatic". Also, how would it work for the sidebar color controls? Would it be okay if I try to follow the same approach as above?
A polite ping, still working on this bug?
(In reply to abstatic from comment #21) > But I can't figure out how to add the color name suffix right at the start, > when the color is set to default/automatic.... > > Also, how would it work for the sidebar color controls? Would it be okay if > I try to follow the same approach as above? Reviewed and commented on the patch; we could go without "Font (Automatic)" and sidebar controls do work like toolbar right now.
Trying to continue in https://gerrit.libreoffice.org/#/c/60261/
Continued here: https://gerrit.libreoffice.org/#/c/61815/
Jim Raykowski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=68c73b2cc26313de315e828cb9f8db53d9aeb6bf tdf#108751 Show currently selected color name in color button tooltip It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
This is a really cool nice gimmick. Thanks all! Verified in Version: 6.2.0.0.alpha1+ (x64) Build ID: 59d48c531a5cad27f02b91c9b86278d5ede211a1 CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; TinderBox: Win-x86_64@42, Branch:master, Time: 2018-10-29_01:05:52 Locale: de-AT (de_AT); Calc: CL