Commit db107ed1 authored by Claes Sjofors's avatar Claes Sjofors

Xtt op window, button text size affected by zoom

parent 74689aad
......@@ -688,7 +688,7 @@ OpGtk::OpGtk( void *op_parent_ctx,
gtk_container_add( GTK_CONTAINER(node_label_bg), node_label);
GtkWidget *node_button = gtk_event_box_new();
gtk_container_set_border_width(GTK_CONTAINER(node_button), 1);
gtk_container_set_border_width(GTK_CONTAINER(node_button), 2);
GtkWidget *node_hbox = gtk_hbox_new( FALSE, 0);
// dcli_translate_filename( fname, "$pwr_exe/xtt_ind_gray2.png");
// GtkWidget *node_image = gtk_image_new_from_file( fname);
......@@ -1176,7 +1176,7 @@ int OpGtk::configure( char *opplace_str)
char *textutf8 = g_convert( button_title[i], -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
// appl_buttons[i] = gtk_button_new_with_label(textutf8);
appl_buttons[i] = gtk_event_box_new();
gtk_container_set_border_width(GTK_CONTAINER(appl_buttons[i]), 1);
gtk_container_set_border_width(GTK_CONTAINER(appl_buttons[i]), 2);
GtkWidget *label = gtk_label_new( textutf8);
g_free( textutf8);
gtk_container_add( GTK_CONTAINER(appl_buttons[i]), label);
......@@ -1342,6 +1342,7 @@ void OpGtk::activate_zoom_in( GtkWidget *w, gpointer data)
op->text_size += 2;
op->update_alarm_info();
op->set_text_size();
}
void OpGtk::activate_zoom_out( GtkWidget *w, gpointer data)
......@@ -1353,6 +1354,7 @@ void OpGtk::activate_zoom_out( GtkWidget *w, gpointer data)
op->text_size -= 2;
op->update_alarm_info();
op->set_text_size();
}
void OpGtk::activate_colortheme( GtkWidget *w, gpointer data)
......@@ -1961,3 +1963,21 @@ void OpGtk::set_color_theme( int idx)
}
}
}
#define FONT_SCALE 0.7
void OpGtk::set_text_size()
{
PangoFontDescription *fd = NULL;
char str[80];
char bold_str[10] = "";
sprintf( str, "%s %s%f", "Lucida Sans", bold_str, FONT_SCALE * (text_size+2));
fd = pango_font_description_from_string( str);
for ( unsigned int i = 0; i < 25; i++) {
if ( appl_buttons[i]) {
gtk_widget_modify_font( GTK_WIDGET(gtk_bin_get_child(GTK_BIN(appl_buttons[i]))), fd);
}
}
}
......@@ -117,6 +117,7 @@ class OpGtk : public Op {
void change_sup_color( void *imagew, op_eSupColor color);
void set_title( char *user);
void set_color_theme( int idx);
void set_text_size();
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_aalarm_ack( GtkWidget *w, gpointer data);
......
xtt/mmi/xtt/src/xtt_alarm_active.png

511 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_alarm_active.png

453 Bytes | W: | H:

xtt/mmi/xtt/src/xtt_alarm_active.png
xtt/mmi/xtt/src/xtt_alarm_active.png
xtt/mmi/xtt/src/xtt_alarm_active.png
xtt/mmi/xtt/src/xtt_alarm_active.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment