diff options
author | mvglasow <michael -at- vonglasow.com> | 2019-01-28 19:02:31 +0100 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2019-01-28 19:03:01 +0100 |
commit | a3c92ca14738f117d39152847e106aa06c804266 (patch) | |
tree | 5bc3866dc4e2b76fe9a183849ab5610a58028805 | |
parent | 7053e8d4a448851cb9916fae7cde23252d6cb4c1 (diff) | |
download | navit-a3c92ca14738f117d39152847e106aa06c804266.tar.gz |
Fix:osd:Fix automatic sizing for toggle_announcer
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r-- | navit/osd/core/osd_core.c | 10 | ||||
-rw-r--r-- | navit/xslt/osd_minimum.xslt | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index eafed7944..e1329ffe2 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -2195,7 +2195,7 @@ struct nav_toggle_announcer { /* FIXME this is actually the click callback, which is set once but never read. Do we need this? */ struct callback *navit_init_cb; char *icon_src; - int icon_h, icon_w, active, last_state; + int active, last_state; }; static void osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *v) { @@ -2233,11 +2233,11 @@ static void osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct na else path = g_strdup_printf(this->icon_src, sound_off); - gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h); + gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, opc->osd_item.w, opc->osd_item.h); if (!gr_image) { g_free(path); path = graphics_icon_path("unknown.png"); - gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h); + gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, opc->osd_item.w, opc->osd_item.h); } dbg(lvl_debug, "gr_image=%p", gr_image); @@ -2282,8 +2282,6 @@ static struct osd_priv *osd_nav_toggle_announcer_new(struct navit *nav, struct o osd_set_std_attr(attrs, &opc->osd_item, 0); opc->osd_item.color_bg.a = 0x0000; - this->icon_w = -1; - this->icon_h = -1; this->last_state = -1; attr = attr_search(attrs, NULL, attr_icon_src); @@ -2295,7 +2293,7 @@ static struct osd_priv *osd_nav_toggle_announcer_new(struct navit *nav, struct o this->icon_src = graphics_icon_path(array[0]); file_wordexp_destroy(we); } else - this->icon_src = graphics_icon_path("%s_48_48.png"); + this->icon_src = graphics_icon_path("%s"); opc->osd_item.command = g_strdup(command); diff --git a/navit/xslt/osd_minimum.xslt b/navit/xslt/osd_minimum.xslt index ca04a7304..5c1e72019 100644 --- a/navit/xslt/osd_minimum.xslt +++ b/navit/xslt/osd_minimum.xslt @@ -21,7 +21,7 @@ <xsl:text>
 </xsl:text> <osd type="text" label="${{tracking.item.street_name}} ${{tracking.item.street_name_systematic}}" x="0" y="{round(-14*number($OSD_SIZE))}" w="100%" h="{round(14*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/> <xsl:text>
 </xsl:text> - <osd type="toggle_announcer" icon_src="%s_{number($ICON_MEDIUM)}_{number($ICON_MEDIUM)}.png" x="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE)))}" y="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE))-94*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}"/> + <osd type="toggle_announcer" icon_src="%s" x="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE)))}" y="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE))-94*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}"/> <xsl:text>
 </xsl:text> <osd type="button" src="zoom_manual" command="autozoom_active=0" x="{round(8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active!=0"/> <xsl:text>
 </xsl:text> |