aboutsummaryrefslogblamecommitdiffstats
path: root/src/bin/elementary/test_scaling.c
blob: 84b20c6130a30c03cc67d94948cd92fcc1f13129 (plain) (tree)
1
2
3
4
5
6
7
8
9


                               
                       
 
    
                                                                                                
 
                              
 
                                                         
                                       
 
                         
                                                                            



                                      
                                         




                                 
                                          




                                  
                                         




                                 
                                         




                                 
                                         




                                 
                                         








                                     
                                                                                                 

                                        
 
                                                      
                                       
                                       

                        
                                                                            
                                      


                         
                                                                            



                                      
                                         
                           
                          


                                                  
                                  
                                 




                            
                                         
                           
                          


                                                  
                                  





                                 
                                         
                           
                          


                                                  
                                  







                                     
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>

void
test_scaling(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
   Evas_Object *win, *bx, *bt;

   win = elm_win_util_standard_add("scaling", "Scaling");
   elm_win_autodel_set(win, EINA_TRUE);

   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 0.5");
   elm_object_scale_set(bt, 0.5);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 0.75");
   elm_object_scale_set(bt, 0.75);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 1.0");
   elm_object_scale_set(bt, 1.0);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 1.5");
   elm_object_scale_set(bt, 1.5);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 2.0");
   elm_object_scale_set(bt, 2.0);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 3.0");
   elm_object_scale_set(bt, 3.0);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   evas_object_resize(win, 320, 320);
   evas_object_show(win);
}

void
test_scaling2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
   Evas_Object *win, *bg, *bx, *fr, *lb;

   win = elm_win_add(NULL, "scaling2", ELM_WIN_BASIC);
   elm_win_title_set(win, "Scaling 2");
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   fr = elm_frame_add(win);
   elm_object_text_set(fr, "Scale: 0.5");
   lb = elm_label_add(win);
   elm_object_text_set(lb,
                       "Parent frame scale<br/>"
                       "is 0.5. Child should<br/>"
                       "inherit it.");
   elm_object_content_set(fr, lb);
   elm_object_scale_set(fr, 0.5);
   evas_object_show(lb);
   elm_box_pack_end(bx, fr);
   evas_object_show(fr);

   fr = elm_frame_add(win);
   elm_object_text_set(fr, "Scale: 1.0");
   lb = elm_label_add(win);
   elm_object_text_set(lb,
                       "Parent frame scale<br/>"
                       "is 1.0. Child should<br/>"
                       "inherit it.");
   elm_object_content_set(fr, lb);
   evas_object_show(lb);
   elm_object_scale_set(fr, 1.0);
   elm_box_pack_end(bx, fr);
   evas_object_show(fr);

   fr = elm_frame_add(win);
   elm_object_text_set(fr, "Scale: 2.0");
   lb = elm_label_add(win);
   elm_object_text_set(lb,
                       "Parent frame scale<br/>"
                       "is 2.0. Child should<br/>"
                       "inherit it.");
   elm_object_content_set(fr, lb);
   evas_object_show(lb);
   elm_object_scale_set(fr, 2.0);
   elm_box_pack_end(bx, fr);
   evas_object_show(fr);

   evas_object_resize(win, 320, 320);
   evas_object_show(win);
}