summaryrefslogtreecommitdiff
path: root/libgnomekbd/gkbd-keyboard-drawing.c
Commit message (Collapse)AuthorAgeFilesLines
* Invert alignment for RTL symbols to place them correctlyDaniel Kahn Gillmor2022-06-221-1/+8
| | | | | | | | | | | | | | https://docs.gtk.org/Pango/method.Layout.set_auto_dir.html says: > When the auto-computed direction of a paragraph differs from the > base direction of the context, the interpretation of > PANGO_ALIGN_LEFT and PANGO_ALIGN_RIGHT are swapped. Now that symbols are placed based using alignment, we don't want RTL symbols placed on the wrong side of the key rendering. To do this, we invert the alignment for RTL symbols. Closes: #8
* GkbdKeyboardDrawing: set_key_label_in_layout returns Bidi informationDaniel Kahn Gillmor2022-06-221-1/+4
| | | | | This information (whether a symbol is LTR or RTL) will be useful in figuring out how to align the symbol on the drawing of the key.
* Make all symbol drawings full-width, using alignment to place themDaniel Kahn Gillmor2022-06-221-30/+15
| | | | | | | | | | | | | | | | Currently, left-displayed symbols (those produced without AltGr) are drawn on a key rendering in a full-width cell, but right-displayed symbols (those produced with AltGr) are only drawn in half-width cells on the key rendering. This means that left-displayed symbols can still overlap with right-hand symbols if they happen to be wide, but right-hand symbols are more likely to be truncated ("ellipsized"). This change still allows the symbols to overlap, but makes right-displayed symbols less likely to be ellipsized. We do this by using alignment to place right-displayed symbols to the right, instead of using a half-width cell.
* gkbd-keyboard-display: Don't crash on unknown layoutRobert Ancell2022-06-221-0/+4
| | | | | Previously would crash when running: $ gkbd-keyboard-display -l nosuchlayout
* Merge branch 'modernize' into 'master'Corentin Noël2022-06-141-20/+7
|\ | | | | | | | | Avoid some deprecated Gdk/Gtk codepaths See merge request GNOME/libgnomekbd!10
| * Avoid use of GdkScreenDaniel Kahn Gillmor2022-04-081-15/+2
| | | | | | | | | | | | | | | | The only places that were using GdkScreen were using it to get monitor width and height. All the gdk_screen_* calls that were being used are explicitly deprecated. Use GdkDisplay instead.
| * Use plain "const" instead of deprecated "G_CONST_RETURN"Daniel Kahn Gillmor2022-04-081-5/+5
| |
* | Use Unicode in translatable stringswip/piotrdrag/unicode-typographyPiotr Drąg2020-07-251-1/+1
|/ | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772762
* gkbd-keyboard-drawing: Don't use deprecated GDK APIRui Matos2016-09-141-13/+4
| | | | | Asking for a keyboard device's position doesn't even make sense anyway.
* gkbd-keyboard-drawing: Don't unset double bufferingRui Matos2016-09-141-1/+0
| | | | It's not needed with modern gtk+ .
* gkbd-keyboard-drawing: Don't set allocation from ::size-allocateRui Matos2016-09-141-6/+3
| | | | This isn't needed and in fact causes runtime warnings.
* gkbd-keyboard-drawing: Use non-deprecated API to get the font descRui Matos2016-09-141-6/+4
|
* gkbd-keyboard-drawing: Handle XkbGetKeyboard() failingRui Matos2016-09-141-12/+15
| | | | | | XkbGetKeyboard() might fail but we might still be able to work with a XkbGetKeyboardByName() later in gkbd_keyboard_drawing_set_keyboard() so don't abort the initialization if it fails.
* gkbd-keyboard-drawing: Prevent gtk+ keynav from taking focus awayRui Matos2016-09-141-1/+1
| | | | | | We need to tell gtk+ we handled the key event otherwise gtk+ keynav key events will move focus to the close button and it looks like the dialog stopped working.
* libgnomekbd/gkbd-keyboard-drawing.c: fix a segfaultAntonio Ospite2016-01-221-1/+1
| | | | | | | | | | | | | | | | | When drawing the keyboard without having set the groups and levels there is a segmentation fault: Program received signal SIGSEGV, Segmentation fault. 0x00007fffe49ae8c9 in draw_key_label (is_pressed=<optimized out>, xkb_height=<optimized out>, xkb_width=<optimized out>, xkb_origin_y=<optimized out>, xkb_origin_x=<optimized out>, angle=0, keycode=<optimized out>, drawing=0xa540e0, context=0xca6080) at gkbd-keyboard-drawing.c:1017 1017 if (drawing->groupLevels[glp] == NULL) Fix that. The widget now is able to draw a keyboard without the keys labels, which can be useful when testing just the keyboard geometry. https://bugzilla.gnome.org/show_bug.cgi?id=760988
* Fix criticalsMichael Catanzaro2016-01-211-1/+3
|
* libgnomekbd/gkbd-keyboard-drawing.c: fix modifier key pressed stateAntonio Ospite2016-01-211-20/+4
| | | | | | | | | | | | | | When track_modifiers is true and a modifier key gets pressed, do not free and reallocate the data and, in particular, do not reallocate drawing->keys zeroing it; this would result in the modifier keys pressed states to be forgotten and the modifier keys not to be shown as pressed when in fact they are (the keyboard symbols reflect the shift level correctly). Fix the current situation, allowing the modifier keys pressed state to be drawn correctly. https://bugzilla.gnome.org/show_bug.cgi?id=734621
* libgnomekbd/gkbd-keyboard-drawing.c: draw keys with invalid keycodesAntonio Ospite2016-01-211-3/+1
| | | | | | | | | | | Some keys like the function key "FN" are described in geometry files but they have no keycode associated to them. You can find such keys in the thinkpad and in the hhk geometry files. Allow drawing the shape of these keys with invalid keycodes, and just skip looking for the labels as the label is derived from the keycode. https://bugzilla.gnome.org/show_bug.cgi?id=734618
* Fix gobject-introspection commentsStef Walter2012-05-121-3/+6
| | | | | | | * Cleans up a bunch of warnings, and gets g-ir-scanner to actually recognize the annotations. https://bugzilla.gnome.org/show_bug.cgi?id=675729
* IndentingSergey V. Udaltsov2012-02-221-12/+27
|
* Changing API from GdkColor to GdkRGBA, GtkStyle to GtkStyleContextSergey V. Udaltsov2012-02-221-53/+65
|
* Small warnings eliminatedSergey V. Udaltsov2011-08-241-22/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=653155
* Trying to be smart chosing the current monitorSergey V. Udaltsov2011-06-111-2/+15
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=647646
* Using primary monitor screen size, not the screen sizeSergey V. Udaltsov2011-05-031-1/+4
| | | | | Using large screens can cause bad, huge, windows http://bugzilla.gnome.org/show_bug.cgi?id=647646
* Slightly increase the font size for the key labelsSergey V. Udaltsov2011-03-141-1/+3
| | | | | It was 10, it is 12 now https://bugzilla.gnome.org/show_bug.cgi?id=642903
* explicit declaration of internal libxklavier functionsSergey V. Udaltsov2011-03-031-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=643754
* Removed "Keyboard Layout" prefix from the preview dialogSergey V. Udaltsov2011-02-251-4/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=642903
* Improved rendering of keysyms. No ISO_, underscores->spacesSergey V. Udaltsov2011-02-241-19/+26
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=642903
* Unneeded wrapping for caps lock removedSergey V. Udaltsov2011-02-241-1/+1
|
* For pressed keys, used the font color from gtk themeSergey V. Udaltsov2011-02-221-19/+29
| | | | http://bugzilla.gnome.org/show_bug.cgi?id=642903
* Removed useless Help buttonSergey V. Udaltsov2011-02-211-5/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=642903
* Make Caps Lock consistent with indicatorSergey V. Udaltsov2011-02-211-0/+4
| | | | http://bugzilla.gnome.org/show_bug.cgi?id=642903
* Do not display VoidSymbol, use "" insteadSergey V. Udaltsov2011-02-171-0/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=34369
* Do not use group name for the kbd drawing dialog titleSergey V. Udaltsov2011-02-101-90/+109
| | | | Use proper name from xml instead of group name
* Improved keyboard drawing dialogSergey V. Udaltsov2011-02-041-14/+39
| | | | API is fixed, proper title taken from libxklavier meta data
* Now, gkbd-keyboard-display is able to show layoutsSergey V. Udaltsov2011-02-031-46/+139
| | | | To be used by g-c-c
* Added gkbd-keyboard-display utilitySergey V. Udaltsov2011-02-031-1/+1
| | | | It is going to be used by the gnome-shell and gnome-control-center
* call gtk_widget_set_allocation from size_allocateSergey V. Udaltsov2011-01-281-1/+1
| | | | And there is no need to invalidate - it will be done anyway
* Proper default dialog sizeSergey V. Udaltsov2011-01-281-30/+68
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=640423 At the same time, gtkvbox still doing strange things, to be continued
* Invalidate only required regionSergey V. Udaltsov2011-01-261-7/+6
| | | | Using widget allocation allows to provide correct invalidation area for updates.
* Specifying explicit line width for outlinesSergey V. Udaltsov2011-01-261-12/+34
| | | | When outlines are too thick, LEDs are not visible at all
* Invalidate entire widgetSergey V. Udaltsov2011-01-251-2/+4
| | | | | | | For some reason, the coordinates are taken from the window corner. Should be investigated. For now, closing https://bugzilla.gnome.org/show_bug.cgi?id=640424 https://bugzilla.gnome.org/show_bug.cgi?id=640422
* Implemented immediate rendering (without idle)Sergey V. Udaltsov2011-01-251-110/+38
| | | | As a side effect, fixed https://bugzilla.gnome.org/show_bug.cgi?id=640424
* Do not highlight when focus is receivedSergey V. Udaltsov2011-01-251-12/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=640425
* Stricter syntaxSergey V. Udaltsov2011-01-241-1/+1
|
* Improved cooords for labels - consider complex outlinesSergey V. Udaltsov2011-01-241-60/+89
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=640425 Also, a bit of indent love
* Fix clipping problems in the drawing widgetMatthias Clasen2011-01-211-0/+1
| | | | | | No-window widgets _must_ call gtk_widget_set_has_window (w, FALSE) in _init; else the clipping/transformation logic in GTK+ gets confused.
* Include gi18n-lib.h in library sources instead of gi18n.h. Fixes bug #639569Gabor Kelemen2011-01-161-1/+1
|
* Cleaning code a bitSergey V. Udaltsov2010-12-241-8/+8
| | | | Preparing for introspection
* Improving rendering of long strings in the kbd previewSergey V. Udaltsov2010-12-221-41/+56
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=633680