Skip to content

Commit

Permalink
UPdated demo with gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Jul 14, 2024
1 parent d8c0081 commit df292da
Show file tree
Hide file tree
Showing 9 changed files with 990 additions and 305 deletions.
942 changes: 942 additions & 0 deletions SquareLine_Project.spj

Large diffs are not rendered by default.

Binary file removed assets/Philips_80x106.png
Binary file not shown.
290 changes: 0 additions & 290 deletions src/ui/images/ui_img_philips_80x106_png.c

This file was deleted.

45 changes: 37 additions & 8 deletions src/ui/screens/ui_scrMain.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#include "../ui.h"
Expand Down Expand Up @@ -83,13 +83,42 @@ void ui_scrMain_screen_init(void)
lv_obj_set_align(ui_lblCountValue, LV_ALIGN_TOP_MID);
lv_label_set_text(ui_lblCountValue, "0");

ui_Image1 = lv_image_create(ui_pnlMain);
lv_image_set_src(ui_Image1, &ui_img_philips_80x106_png);
lv_obj_set_width(ui_Image1, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_Image1, LV_SIZE_CONTENT); /// 1
lv_obj_set_align(ui_Image1, LV_ALIGN_BOTTOM_RIGHT);
lv_obj_add_flag(ui_Image1, LV_OBJ_FLAG_ADV_HITTEST); /// Flags
lv_obj_remove_flag(ui_Image1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
ui_GradR = lv_obj_create(ui_pnlMain);
lv_obj_remove_style_all(ui_GradR);
lv_obj_set_height(ui_GradR, 20);
lv_obj_set_width(ui_GradR, lv_pct(50));
lv_obj_set_x(ui_GradR, 0);
lv_obj_set_y(ui_GradR, -40);
lv_obj_set_align(ui_GradR, LV_ALIGN_BOTTOM_RIGHT);
lv_obj_remove_flag(ui_GradR, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_GradR, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_GradR, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_color(ui_GradR, lv_color_hex(0xFF0000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_dir(ui_GradR, LV_GRAD_DIR_HOR, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_GradG = lv_obj_create(ui_pnlMain);
lv_obj_remove_style_all(ui_GradG);
lv_obj_set_height(ui_GradG, 20);
lv_obj_set_width(ui_GradG, lv_pct(50));
lv_obj_set_x(ui_GradG, 0);
lv_obj_set_y(ui_GradG, -20);
lv_obj_set_align(ui_GradG, LV_ALIGN_BOTTOM_RIGHT);
lv_obj_remove_flag(ui_GradG, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_GradG, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_GradG, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_color(ui_GradG, lv_color_hex(0x00FF00), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_dir(ui_GradG, LV_GRAD_DIR_HOR, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_GradB = lv_obj_create(ui_pnlMain);
lv_obj_remove_style_all(ui_GradB);
lv_obj_set_height(ui_GradB, 20);
lv_obj_set_width(ui_GradB, lv_pct(50));
lv_obj_set_align(ui_GradB, LV_ALIGN_BOTTOM_RIGHT);
lv_obj_remove_flag(ui_GradB, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_GradB, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_GradB, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_color(ui_GradB, lv_color_hex(0x0000FF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_dir(ui_GradB, LV_GRAD_DIR_HOR, LV_PART_MAIN | LV_STATE_DEFAULT);

lv_obj_add_event_cb(ui_Rotate, ui_event_Rotate, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_btnCount, ui_event_btnCount, LV_EVENT_ALL, NULL);
Expand Down
6 changes: 4 additions & 2 deletions src/ui/ui.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#include "ui.h"
Expand All @@ -25,7 +25,9 @@ lv_obj_t * ui_btnCount;
lv_obj_t * ui_lblButton;
lv_obj_t * ui_lblCount;
lv_obj_t * ui_lblCountValue;
lv_obj_t * ui_Image1;
lv_obj_t * ui_GradR;
lv_obj_t * ui_GradG;
lv_obj_t * ui_GradB;
lv_obj_t * ui____initial_actions0;
const lv_image_dsc_t * ui_imgset_philips_80x[1] = {&ui_img_philips_80x106_png};

Expand Down
6 changes: 4 additions & 2 deletions src/ui/ui.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#ifndef _SQUARELINE_PROJECT_UI_H
Expand Down Expand Up @@ -31,7 +31,9 @@ extern lv_obj_t * ui_btnCount;
extern lv_obj_t * ui_lblButton;
extern lv_obj_t * ui_lblCount;
extern lv_obj_t * ui_lblCountValue;
extern lv_obj_t * ui_Image1;
extern lv_obj_t * ui_GradR;
extern lv_obj_t * ui_GradG;
extern lv_obj_t * ui_GradB;
extern lv_obj_t * ui____initial_actions0;


Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_events.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#ifndef _UI_EVENTS_H
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_helpers.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#include "ui_helpers.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_helpers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// LVGL version: 9.1.0
// Project name: SquareLine_Project

#ifndef _SQUARELINE_PROJECT_UI_HELPERS_H
Expand Down

0 comments on commit df292da

Please sign in to comment.