summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-25 18:32:54 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-25 18:32:54 +0300
commit84d3089735bd81a9d628acf416b481f2535765cf (patch)
tree762303b237cb4d34909a175a2b62bf2ec74d23c6 /src/ui/util.c
parent8700c039dc04b4c9f22584d4e901ed372442b0f4 (diff)
Document side elements; hover outline
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 5d283742..27bac834 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 36
37#include <the_Foundation/math.h> 37#include <the_Foundation/math.h>
38#include <the_Foundation/path.h> 38#include <the_Foundation/path.h>
39#include <SDL_timer.h>
39 40
40iBool isCommand_SDLEvent(const SDL_Event *d) { 41iBool isCommand_SDLEvent(const SDL_Event *d) {
41 return d->type == SDL_USEREVENT && d->user.code == command_UserEventCode; 42 return d->type == SDL_USEREVENT && d->user.code == command_UserEventCode;
@@ -140,7 +141,7 @@ void init_Anim(iAnim *d, float value) {
140 141
141void setValue_Anim(iAnim *d, float to, uint32_t span) { 142void setValue_Anim(iAnim *d, float to, uint32_t span) {
142 if (fabsf(to - d->to) > 0.00001f) { 143 if (fabsf(to - d->to) > 0.00001f) {
143 const uint32_t now = frameTime_Window(get_Window()); 144 const uint32_t now = SDL_GetTicks();
144 d->from = value_Anim(d); 145 d->from = value_Anim(d);
145 d->to = to; 146 d->to = to;
146 d->when = now; 147 d->when = now;
@@ -918,6 +919,13 @@ iWidget *makePreferences_Widget(void) {
918 } 919 }
919 /* Layout. */ { 920 /* Layout. */ {
920 appendTwoColumnPage_(tabs, "Layout", '2', &headings, &values); 921 appendTwoColumnPage_(tabs, "Layout", '2', &headings, &values);
922 addChild_Widget(headings, iClob(makeHeading_Widget("Font:")));
923 iWidget *fonts = new_Widget();
924 /* Fonts. */ {
925 addRadioButton_(fonts, "prefs.font.0", "Nunito", "font.set arg:0");
926 addRadioButton_(fonts, "prefs.font.1", "Fira Sans", "font.set arg:1");
927 }
928 addChildFlags_Widget(values, iClob(fonts), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
921 addChild_Widget(headings, iClob(makeHeading_Widget("Line width:"))); 929 addChild_Widget(headings, iClob(makeHeading_Widget("Line width:")));
922 iWidget *widths = new_Widget(); 930 iWidget *widths = new_Widget();
923 /* Line widths. */ { 931 /* Line widths. */ {