-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from nucleic/feature-stylesheet
Feature stylesheet
- Loading branch information
Showing
34 changed files
with
2,917 additions
and
27 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
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,27 @@ | ||
.. module:: enaml.styling | ||
|
||
============= | ||
enaml.styling | ||
============= | ||
|
||
.. rubric:: Classes | ||
|
||
.. autosummary:: | ||
:nosignatures: | ||
|
||
Setter | ||
Stylable | ||
Style | ||
StyleCache | ||
StyleSheet | ||
|
||
|
||
.. autoclass:: Setter | ||
|
||
.. autoclass:: Stylable | ||
|
||
.. autoclass:: Style | ||
|
||
.. autoclass:: StyleCache | ||
|
||
.. autoclass:: StyleSheet |
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,50 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, PushButton | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
from enaml.qt.qt_application import ( | ||
QtApplication | ||
) | ||
|
||
enamldef AppSheet(StyleSheet): | ||
Style: | ||
element = 'PushButton' | ||
Setter: | ||
field = 'color' | ||
value = 'blue' | ||
|
||
enamldef View(Window): | ||
title = 'Style Sheet' | ||
Container: | ||
Container: | ||
padding = 0 | ||
StyleSheet: | ||
Style: | ||
element = 'PushButton' | ||
Setter: | ||
field = 'color' | ||
value = 'red' | ||
PushButton: | ||
text = 'One' | ||
PushButton: | ||
text = 'Two' | ||
PushButton: | ||
text = 'Three' | ||
PushButton: | ||
text = 'Four' | ||
PushButton: | ||
text = 'Five' | ||
StyleSheet: | ||
Style: | ||
Setter: | ||
field = 'color' | ||
value = 'green' | ||
|
||
def main(): | ||
app = QtApplication() | ||
app.style_sheet = AppSheet() | ||
view = View() | ||
view.show() | ||
app.start() |
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,29 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, Field, CheckBox | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
|
||
enamldef Main(Window): | ||
title = 'Style Sheet' | ||
StyleSheet: | ||
Style: | ||
element = 'CheckBox' | ||
pseudo_class = 'checked' | ||
Setter: | ||
field = 'color' | ||
value = 'indianred' | ||
Style: | ||
element = 'Field' | ||
pseudo_class = 'focus' | ||
Setter: | ||
field = 'color' | ||
value = 'green' | ||
Container: | ||
CheckBox: | ||
text = 'One' | ||
CheckBox: | ||
text = 'Two' | ||
Field: | ||
text = 'Three' |
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,25 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, GroupBox, PushButton | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
|
||
enamldef Main(Window): | ||
title = 'Style Sheet' | ||
StyleSheet: | ||
Style: | ||
element = 'GroupBox' | ||
pseudo_element = 'title' | ||
Setter: | ||
field = 'color' | ||
value = 'indianred' | ||
Container: | ||
GroupBox: | ||
title = 'Group Box' | ||
PushButton: | ||
text = 'One' | ||
PushButton: | ||
text = 'Two' | ||
PushButton: | ||
text = 'Three' |
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,44 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, PushButton, Field, | ||
CheckBox | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
|
||
enamldef Main(Window): | ||
title = 'Style Sheet' | ||
StyleSheet: | ||
Style: | ||
element = 'PushButton' | ||
Setter: | ||
field = 'color' | ||
value = 'red' | ||
Style: | ||
style_class = 'blue-class' | ||
Setter: | ||
field = 'color' | ||
value = 'blue' | ||
Style: | ||
object_name = 'special' | ||
Setter: | ||
field = 'color' | ||
value = 'green' | ||
Setter: | ||
field = 'font-weight' | ||
value = 'bold' | ||
Container: | ||
PushButton: | ||
text = 'One' | ||
PushButton: | ||
text = 'Two' | ||
Field: | ||
style_class = 'blue-class' | ||
text = 'Three' | ||
CheckBox: | ||
style_class = 'blue-class' | ||
text = 'Four' | ||
checked = True | ||
PushButton: | ||
text = 'Five' | ||
name = 'special' |
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,22 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, PushButton | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
|
||
enamldef Main(Window): | ||
title = 'Style Sheet' | ||
StyleSheet: | ||
Style: | ||
element = 'PushButton' | ||
Setter: | ||
field = 'color' | ||
value = 'blue' | ||
Container: | ||
PushButton: | ||
text = 'First' | ||
PushButton: | ||
text = 'Second' | ||
PushButton: | ||
text = 'Third' |
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,56 @@ | ||
from enaml.widgets.api import ( | ||
Window, Container, PushButton, Field | ||
) | ||
from enaml.styling import ( | ||
StyleSheet, Style, Setter | ||
) | ||
|
||
enamldef Main(Window): | ||
title = 'Style Sheet' | ||
StyleSheet: | ||
Style: | ||
element = 'PushButton' | ||
Setter: | ||
field = 'color' | ||
value = 'blue' | ||
Style: | ||
element = 'PushButton' | ||
style_class = 'alpha' | ||
Setter: | ||
field = 'color' | ||
value = 'red' | ||
Style: | ||
element = 'PushButton' | ||
style_class = 'beta' | ||
Setter: | ||
field = 'color' | ||
value = 'green' | ||
Style: | ||
style_class = 'alpha, beta' | ||
Setter: | ||
field = 'color' | ||
value = 'steelblue' | ||
Setter: | ||
field = 'font' | ||
value = 'bold 12pt Arial' | ||
Style: | ||
object_name = 'special' | ||
Setter: | ||
field = 'color' | ||
value = 'goldenrod' | ||
Container: | ||
PushButton: | ||
text = 'One' | ||
PushButton: | ||
text = 'Two' | ||
style_class = 'alpha' | ||
PushButton: | ||
text = 'Three' | ||
style_class = 'beta' | ||
Field: | ||
text = 'Four' | ||
style_class = 'alpha beta' | ||
PushButton: | ||
text = 'Five' | ||
style_class = 'alpha beta' | ||
name = 'special' |
Oops, something went wrong.