This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
389 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Rate | ||
|
||
Rate component can be used to show evaluation, and it provide a quick rating operation on something. | ||
|
||
## Basic | ||
|
||
The simplest usage. | ||
|
||
``` rate-basic-demo-xml | ||
<rate /> | ||
``` | ||
|
||
## Readonly | ||
|
||
Set the `disabled` attribute to disable mouse interaction. | ||
|
||
``` rate-readonly-demo-xml | ||
<rate value="2" disabled="disabled" /> | ||
``` | ||
|
||
## Other star count | ||
|
||
The default number of stars is 5, you can set it with the `count` attribute. | ||
|
||
``` rate-count-demo-xml | ||
<rate count="10" /> | ||
``` | ||
|
||
## Other icon | ||
|
||
Replace the default star to other iconfont. | ||
|
||
``` rate-icon-demo-xml | ||
<rate icon="heart" void-icon="heart-outline" /> | ||
<w class="mb-2" /> | ||
<rate icon="emoticon-happy" void-icon="emoticon-neutral-outline" /> | ||
``` | ||
|
||
## Other character | ||
|
||
Replace the default star to other character like alphabet, digit or even Chinese word. | ||
|
||
``` rate-character-demo-xml | ||
<rate character="A" /> | ||
<w class="mb-2" /> | ||
<rate character="好" /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* rate.h -- Rate component. | ||
* | ||
* Copyright (c) 2019, Liu chao <[email protected]> All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of LCUI nor the names of its contributors may be used | ||
* to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef LCDESIGN_RATE_H_ | ||
#define LCDESIGN_RATE_H_ | ||
|
||
void Rate_SetValue(LCUI_Widget w, unsigned value); | ||
|
||
unsigned Rate_GetValue(LCUI_Widget w); | ||
|
||
void Rate_SetCount(LCUI_Widget w, unsigned count); | ||
|
||
void Rate_SetIcon(LCUI_Widget w, const char *void_icon, const char *icon); | ||
|
||
void Rate_SetCharacter(LCUI_Widget w, const wchar_t ch); | ||
|
||
void LCDesign_InitRate(void); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
rate { | ||
display: inline-block; | ||
|
||
icon, | ||
span { | ||
font-size: $rate-star-size; | ||
display: inline-block; | ||
color: $rate-star-color; | ||
margin-right: map-get($spacers, 2); | ||
} | ||
} | ||
|
||
.rate-star-void { | ||
color: $rate-star-void-color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.