View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#192
Originally Posted by No!No!No!Yes! View Post
Uhm ... no easy way to preserve backward compatibility if I implement this feature with Hildon-Extras extensions.
Especially if exported instances, with extended-fonts functionalities, need to be read by older releases.

Same happens if I change Color (both foreground and background) dialog with extended and more cosmetic one.

Unless it is polite to ask users to check and change fonts/color after import.


BTW, is it possible that HeColorButton is a bit buggy with PR1.2 SDK?

In scratchbox, if I click on black button frame then color dialogs opens, if I click on orange rectangle nothing happens...

Ciao.

UPDATE:
Also if I compile this:
Code:
		GtkWidget *cmdFontBox = gtk_hbox_new (FALSE, 0);//AP1

		GtkWidget *cmdFontSz;
		if (!g_strcmp0(self->priv->cmdExtFont,"")) {
			GtkWidget *cmdFontFam = hildon_touch_selector_new_text ();//AP1
			for(i=0;p_fonts[i]!=NULL;i++) {//AP1
				int j;
				for (j=0;j<4;j++) {//AP1
					gchar fs[256];//AP1
					g_sprintf(fs, "%s %s",p_fonts[i], p_fonts_types[j]);//AP1
					hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (cmdFontFam), fs);//AP1
				}//AP1
			}//AP1
			hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (cmdFontFam), 0, self->priv->cmdFontName);//AP1

			GtkWidget * cmdFontSelector = hildon_picker_button_new (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_THUMB_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL);//AP1
			hildon_button_set_title (HILDON_BUTTON (cmdFontSelector), "Font Face: ");//AP1
			hildon_button_set_alignment (HILDON_BUTTON (cmdFontSelector), 0, 0.5, 0, 0);//AP1
			hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (cmdFontSelector), HILDON_TOUCH_SELECTOR (cmdFontFam));//AP1
			gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontSelector, FALSE, FALSE, 0);//AP1

			cmdFontSz = gtk_hscale_new_with_range ((gdouble)8, (gdouble)72, (gdouble)1);//AP1
			gtk_range_set_value(GTK_RANGE(cmdFontSz), self->priv->cmdFontSize);//AP1
			gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontSz, TRUE, TRUE, 0);//AP1
		}
		GtkWidget *cmdFontFam = he_font_button_new_with_font (self->priv->cmdExtFont);
		gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontFam, TRUE, TRUE, 0);

		gtk_container_add (GTK_CONTAINER (content_area), cmdFontBox);//AP1
Everything goes fine ... if I move the he_font_button before the old font selectors and scales ... H-H dumps

Code:
		GtkWidget *cmdFontBox = gtk_hbox_new (FALSE, 0);//AP1

		GtkWidget *cmdFontSz;
		GtkWidget *cmdFontFam = he_font_button_new_with_font (self->priv->cmdExtFont);
		gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontFam, TRUE, TRUE, 0);
		if (!g_strcmp0(self->priv->cmdExtFont,"")) {
			GtkWidget *cmdFontFam = hildon_touch_selector_new_text ();//AP1
			for(i=0;p_fonts[i]!=NULL;i++) {//AP1
				int j;
				for (j=0;j<4;j++) {//AP1
					gchar fs[256];//AP1
					g_sprintf(fs, "%s %s",p_fonts[i], p_fonts_types[j]);//AP1
					hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (cmdFontFam), fs);//AP1
				}//AP1
			}//AP1
			hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (cmdFontFam), 0, self->priv->cmdFontName);//AP1

			GtkWidget * cmdFontSelector = hildon_picker_button_new (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_THUMB_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL);//AP1
			hildon_button_set_title (HILDON_BUTTON (cmdFontSelector), "Font Face: ");//AP1
			hildon_button_set_alignment (HILDON_BUTTON (cmdFontSelector), 0, 0.5, 0, 0);//AP1
			hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (cmdFontSelector), HILDON_TOUCH_SELECTOR (cmdFontFam));//AP1
			gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontSelector, FALSE, FALSE, 0);//AP1

			cmdFontSz = gtk_hscale_new_with_range ((gdouble)8, (gdouble)72, (gdouble)1);//AP1
			gtk_range_set_value(GTK_RANGE(cmdFontSz), self->priv->cmdFontSize);//AP1
			gtk_box_pack_start (GTK_BOX (cmdFontBox), cmdFontSz, TRUE, TRUE, 0);//AP1
		}

		gtk_container_add (GTK_CONTAINER (content_area), cmdFontBox);//AP1
As a second thought with respect to innovations in font and color settings for command and results labels I implemented the new extended font dialog as proposed by qwerty12.

I believe pros will be much more than cons and side effects will be bearable...:
  • Old font selection and button is deprecated
  • Backward compatibility for instances exported from previous releases is guaranteed and settings upgraded as necessary during import
  • Exported instances from release 0.1.9 onward will have their fonts reset to command="Nokia Sans bold italic 12" results="Nokia Sans bold 12" when/if imported in previous releases
Faheem, if you are planning to come up with some bugfixing for the color button issue I'll try to release, into PR1.2 extras-devel repository for preliminary testing, a 0.1.9 working release with enhanced font/color settings within 1 or 2 days.
Otherwise only the font enhancement will be published.
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-05-27 at 15:07.