Commit graph

104 commits

Author SHA1 Message Date
Julien Danjou
5f26ab448c Free the previously opened font if changing it via widget_tell in textbox 2008-03-23 15:52:17 +01:00
marco candrian
397aa33163 widget error infrastructure additions 2008-03-23 15:52:16 +01:00
Julien Danjou
0e69534a65 Add a common error infratructure for widget_tell
Signed-off-by: Marco Candrian <mac@calmar.ws>
2008-03-23 15:52:16 +01:00
marco candrian
57e9cb468f textbox handles properties now
text, fg, bg, font, width and text_align actually
2008-03-23 15:52:16 +01:00
marco candrian
3569ab617d new property argument to widget _tell functions
actually the _tell function won't handle the new argument.
Coming patches will handle them.

it will need now something like this:

echo '0 widget_tell widget property value'

where property can be anything used in the awesomerc file,
that means what will be supported. Like: fg, fg_end, width, font...

(actually it ignores the property value and changes what have been changed in
the past as well.)
2008-03-23 15:52:16 +01:00
Julien Danjou
4451e9099e Add support for text shadow, add new text_shadow_offset option. 2008-03-23 15:52:15 +01:00
Julien Danjou
86927a9e7e textbox can be flex-aligned 2008-02-28 16:19:38 +01:00
Julien Danjou
b7d79d8bea use physical screen 2008-02-26 07:15:24 +01:00
Julien Danjou
ae75f55acd change draw_color_new() proto to fill the struct and return status 2008-02-13 08:58:21 +01:00
Julien Danjou
0bfa880b0f add align option to widget to specify their alignment 2008-02-08 10:59:55 +01:00
Julien Danjou
91f80b251c rename align to text_align 2008-02-08 09:58:36 +01:00
Julien Danjou
b6642e45c8 rename initxcolor to draw_color_new() and move it to draw.c 2008-01-27 18:56:37 +01:00
Julien Danjou
35803aff4c make draw functions more independant 2008-01-24 18:43:24 +01:00
Julien Danjou
f3aa1ede5c textbox width is limited to unused space 2008-01-23 08:28:02 +01:00
Julien Danjou
668702b777 move list.h and util.[ch] to common/ 2008-01-21 18:14:59 +01:00
Julien Danjou
9f28582820 add Display as arg 2008-01-21 16:31:14 +01:00
Julien Danjou
17a8c4a4c4 draw_text takes a Area as arg 2008-01-21 16:31:14 +01:00
Nikos Ntarmos
cedfecc68d Simplify textbox_tell
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-15 17:18:07 +01:00
Julien Danjou
a41c25c0f5 modify the tell function to respect spaces 2008-01-07 15:48:42 +01:00
Rico Schiekel
079569e6b4 tell textbox widget colors
usage is simple:
,----
| echo "<screen> widget_tell <mytextbox> #[fg_color] #[bg_color] <text>" | awesome-client
| e.g.
| echo "0 widget_tell t normal behaviour" | awesome-client
| echo "0 widget_tell t #ff0000 red text on default background" | awesome-client
| echo "0 widget_tell t #ffffff #ff0000 white text on red background" | awesome-client
| ...
`----
the fg and bg colors are optional. if not given, the last state is
used.
2008-01-07 15:21:50 +01:00
Julien Danjou
9fa01e34de rename textwidth to draw_textwidth 2008-01-06 22:57:23 +01:00
Julien Danjou
b1c62a618f store widget height 2008-01-05 12:44:14 +01:00
Julien Danjou
609318cbec use 2 vars for knowing if users supplied coords 2008-01-05 12:35:12 +01:00
Nikos Ntarmos
64658bcf93 widgets/textbox.c area.x miscalculation due to variable width 2008-01-05 09:12:20 +01:00
Julien Danjou
a4c09d142c add support for x,y coords supplying in widgets 2008-01-04 22:05:52 +01:00
Julien Danjou
6ca7d7b2db use Area in Widget 2008-01-04 21:46:25 +01:00
Julien Danjou
1d6613349e typedef enum Alignment 2008-01-04 19:17:20 +01:00
Julien Danjou
ec53f3d070 add align option to textbox 2008-01-03 16:02:41 +01:00
Julien Danjou
aed3e569de add a align option to draw_text 2008-01-03 15:57:07 +01:00
Julien Danjou
9fc22e9e4e remove some get_phys_screen() calls 2008-01-02 17:41:03 +01:00
Julien Danjou
2f19bab193 simplify update 2008-01-02 15:01:30 +01:00
Julien Danjou
4f65aa8f51 rework headers inclusion 2008-01-01 18:02:36 +01:00
Julien Danjou
13e5b96807 don't stick textbox size to the first textsize sent via widget_tell 2007-12-30 21:03:22 +01:00
Julien Danjou
75c7d04adf allow textbox to have special width 2007-12-30 14:49:03 +01:00
Julien Danjou
0eb4743385 draw_text don't pad with font->height / 2 by default: padding is now an arg 2007-12-30 14:42:51 +01:00
Julien Danjou
360d9023a4 allow textbox widgets to have their own font 2007-12-29 16:04:06 +01:00
Julien Danjou
c900e37843 add mouse bindings to status bar 2007-12-27 15:49:00 +01:00
Julien Danjou
33add50256 store location and width of each widgets 2007-12-27 11:35:45 +01:00
Julien Danjou
7be6a97972 change "default" in textbox to "text" and set it to a good default 2007-12-27 00:16:29 +01:00
Julien Danjou
d428982af7 simplify 2007-12-23 13:46:36 +01:00
Julien Danjou
b0a8522466 rename a bunch of widget functions 2007-12-22 20:55:17 +01:00
Julien Danjou
c232576631 rename a bunch of draw functions 2007-12-22 20:17:24 +01:00
Julien Danjou
e505b76062 cosmetic + copyright 2007-12-22 15:41:28 +01:00
Aldo Cortesi
7190e4fa48 Change awesome_config -> AwesomeConf.
All other struct definitions in the project follow this naming convention.
2007-12-19 10:43:02 +01:00
Aldo Cortesi
9bb28772ed Make textbox foreground and background configurable. 2007-12-19 10:41:50 +01:00
Aldo Cortesi
ce556ec743 The preferred line length is 80 characters. 2007-12-18 11:27:26 +01:00
Aldo Cortesi
205f2c55ca Make "Statusbar statusbar" the in VirtScreen "Statusbar *statusbar". This is
more consistent with the rest of the interface, and will make our life easier
when we have mulitiple statusbars per screen.
2007-12-18 11:26:18 +01:00
Aldo Cortesi
21fe1add9e Make drawtext interface more general. 2007-12-18 11:25:50 +01:00
Aldo Cortesi
4723ab3627 This patch is a first draft of independently targetable textboxes, and a
protocol to speak to them. Given a textbox widget definition like this:

        textbox mail {
            default = 0
        }
        textbox time {}

We can update the boxes individually by going:

    echo 0 tell_widget mail 10
    echo 0 tell_widget time 12:01

Text boxes will dynamically resize to fit their contents. A textbox can be
cleared by going:

    echo 0 tell_widget name

A text-box containing no text will take up 0 space in the bar, i.e. it will not
be visible at all

Textboxes now supersede statusbar_set_text, so this call has been removed.
2007-12-17 18:22:05 +01:00
Aldo Cortesi
5923c90aaa Solidify widgets.
Factor out common initialisation into a common_new function. Copy the section
title into the Widget title attribute.
2007-12-16 12:57:47 +01:00
Aldo Cortesi
8880a3804e Simplify widget draw interface. 2007-12-16 12:54:42 +01:00
Aldo Cortesi
2f74c079aa Massive, massive interface refactoring.
The big change here is that we now keep our configuration structure in a global
variable called globalconf. This radically simplifies many interfaces, since
passing awesomeconf everywhere is no longer necessary. There are also more
subtle interface effects - now we can reliably identify a screen from just a
screen ID, rather than an awesomeconf, screenid tuple.

Overall, this patch makes most of the interfaces in awesome much nicer to use -
enjoy!

Yes, this is a huge patch, but since a lot of the refactoring was done
systematically using vim macros, splitting this up would have been very hard.
2007-12-16 12:12:48 +01:00
Julien Danjou
3b013f90b1 cosmetic and don't cast for nothing 2007-12-15 16:25:54 +01:00
Aldo Cortesi
76ddf235ac Widget-ise the statusbar.
We now have the beginnings of a flexible widget structure for the statusbar.
For now, there is no behavioural change, and the interface is a bit crude, but
watch this space!
2007-12-15 10:15:42 +01:00