diff options
author | Matteo Galiazzo <matteo@maltesenarrazioni.it> | 2008-05-05 12:05:52 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-05-05 12:05:52 (GMT) |
commit | 4a3be045b28edac4953be9f195640654f8b5a1a1 (patch) | |
tree | 4b2e6466b54a5fb4bb6406ff9cf38c420be032df /src/TooltipWindow.hh | |
parent | ba604ac821b7c1c89d10b0e8c9f85fde948856ef (diff) | |
download | fluxbox-4a3be045b28edac4953be9f195640654f8b5a1a1.zip fluxbox-4a3be045b28edac4953be9f195640654f8b5a1a1.tar.bz2 |
add tooltips for iconbar buttons when title is too long to fit
Diffstat (limited to 'src/TooltipWindow.hh')
-rw-r--r-- | src/TooltipWindow.hh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/TooltipWindow.hh b/src/TooltipWindow.hh new file mode 100644 index 0000000..03abc1d --- /dev/null +++ b/src/TooltipWindow.hh | |||
@@ -0,0 +1,53 @@ | |||
1 | // TooltipWindow.hh | ||
2 | // Copyright (c) 2008 Fluxbox Team (fluxgen at fluxbox dot org) | ||
3 | // | ||
4 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | // copy of this software and associated documentation files (the "Software"), | ||
6 | // to deal in the Software without restriction, including without limitation | ||
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | // and/or sell copies of the Software, and to permit persons to whom the | ||
9 | // Software is furnished to do so, subject to the following conditions: | ||
10 | // | ||
11 | // The above copyright notice and this permission notice shall be included in | ||
12 | // all copies or substantial portions of the Software. | ||
13 | // | ||
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | // DEALINGS IN THE SOFTWARE.#ifndef TOOLTIPWINDOW_HH_ | ||
21 | #ifndef TOOLTIPWINDOW_HH_ | ||
22 | #define TOOLTIPWINDOW_HH_ | ||
23 | |||
24 | #include "OSDWindow.hh" | ||
25 | #include "FbTk/Command.hh" | ||
26 | #include "FbTk/RefCount.hh" | ||
27 | #include "FbTk/Timer.hh" | ||
28 | #include "FbTk/SimpleCommand.hh" | ||
29 | |||
30 | |||
31 | class TooltipWindow : public OSDWindow { | ||
32 | public: | ||
33 | TooltipWindow(const FbTk::FbWindow &parent, BScreen &screen, | ||
34 | FbTk::ThemeProxy<FbWinFrameTheme> &theme); | ||
35 | |||
36 | void showText(const std::string &text); | ||
37 | void setDelay(int iDelay) { | ||
38 | delay = iDelay; | ||
39 | timer.setTimeout(delay); | ||
40 | } | ||
41 | void hide() ; | ||
42 | |||
43 | private: | ||
44 | void raiseTooltip(); | ||
45 | void show(); | ||
46 | int delay; | ||
47 | std::string lastText; | ||
48 | FbTk::Timer timer; | ||
49 | }; | ||
50 | |||
51 | |||
52 | |||
53 | #endif /*TOOLTIPWINDOW_HH_*/ | ||