diff --git a/docs/assets/drop-down.png b/docs/assets/drop-down.png new file mode 100644 index 0000000..2127eac Binary files /dev/null and b/docs/assets/drop-down.png differ diff --git a/docs/assets/plugins.png b/docs/assets/plugins.png new file mode 100644 index 0000000..b4550d4 Binary files /dev/null and b/docs/assets/plugins.png differ diff --git a/docs/assets/radio-btn.png b/docs/assets/radio-btn.png new file mode 100644 index 0000000..a328ee0 Binary files /dev/null and b/docs/assets/radio-btn.png differ diff --git a/docs/intro.md b/docs/intro.md index 9c57ab5..b40af56 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -25,6 +25,11 @@ Things you can do on canvas. 3. zoom using `+`/`-` keys 4. Delete widgets using `del` key or right clicking on the widget +## Project name +By default all project's are named untitled project, you can change this from the header input next to export code. + +## Selecting a UI library +You can select the UI library from the header dropdown. Once selected changing the UI library in between your work, will erase the canvas. ## Widgets @@ -64,7 +69,9 @@ or right-click -> delete ### Variable names To modify variable name, change the widget name attributes, if there are duplicate names, -the code generation engine will automatically add a count. Every widget name will be converted +the code generation engine will automatically add a count to the the variable name, eg: var1, var2. + +Every widget name will be converted to snake case.  @@ -83,6 +90,20 @@ Now under the label attributes you'll be able to see image upload option. Select  +### Adding options to radio button + +To add more option to radio button click on the radio button widget then on the toolbar -> +under radio group -> add input + + + +### Adding options to select dropdown. + +Adding more options to select dropdown is similar to radio buttons as shown above. + + + + ## Layouts There are 3 main layouts. The layouts are set by the parents. Once a layout is set @@ -110,3 +131,21 @@ Grid is a 2d layout manager, you can position each widget by clicking on widget You can use position absolute for specific widget by checking the absolute positing attribute  + + +## Plugins + +Plugins are third party UI libraries. You can drag and drop the plugins just like widgets onto the canvas. The plugin card on the sidebar contains information about the library, such as library repo and license. + + + + +## Exporting code +Once you are happy with the UI, you can click on export code from the header. + +## Requirements.txt +The requirements.txt files are auto generated, before running the code ensure you have installed the dependencies. + +## Saving the file + +Files are not saved or stored. However this is an upcoming feature for the [Premium users](https://github.com/PaulleDemon/PyUIBuilder?tab=readme-ov-file#license---fund-the-development) \ No newline at end of file diff --git a/src/canvas/widgets/base.js b/src/canvas/widgets/base.js index 3eed165..e495ddd 100644 --- a/src/canvas/widgets/base.js +++ b/src/canvas/widgets/base.js @@ -645,8 +645,8 @@ class Widget extends React.Component { */ setWidgetSize(width, height) { - const fitWidth = this.state.fitContent.width || true - const fitHeight = this.state.fitContent.height || true + const fitWidth = this.state.fitContent?.width + const fitHeight = this.state.fitContent?.height if (fitWidth && fitHeight){ message.warning("both width and height are set to fit-content, unset it to start resizing") diff --git a/src/frameworks/tkinter/plugins/analogTimepicker.js b/src/frameworks/tkinter/plugins/analogTimepicker.js index 5352464..ca631a9 100644 --- a/src/frameworks/tkinter/plugins/analogTimepicker.js +++ b/src/frameworks/tkinter/plugins/analogTimepicker.js @@ -39,10 +39,12 @@ class AnalogTimePicker extends TkinterBase{ this.timePickerRef = React.createRef() + this.minSize = {width: 100, height: 100} + this.state = { ...this.state, widgetName: "Timepicker", - size: { width: 'fit', height: 'fit' }, + size: { width: 250, height: 350 }, attrs: { ...newAttrs, styling: { @@ -118,7 +120,9 @@ class AnalogTimePicker extends TkinterBase{ super.componentDidMount() this.timePicker = timePicker({ element: this.timePickerRef.current, - mode: "12" + mode: "12", + width: this.state.size.width, + // height: this.state.size.height }) // used to remove ok and cancel buttons @@ -132,6 +136,11 @@ class AnalogTimePicker extends TkinterBase{ this.timePicker.dispose() } + setResize(pos, size){ + super.setResize(pos, size) + this.timePicker.setWidth(size.width) + } + handleThemeChange(value){ this.setAttrValue("styling.theme", value) @@ -241,7 +250,7 @@ class AnalogTimePicker extends TkinterBase{ return (