Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
be91490d
Commit
be91490d
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Enhance community tile style and behaviour
parent
7974ce4d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/gui/community_tile.py
+27
-3
27 additions, 3 deletions
src/sakia/gui/community_tile.py
with
27 additions
and
3 deletions
src/sakia/gui/community_tile.py
+
27
−
3
View file @
be91490d
...
...
@@ -23,9 +23,25 @@ class CommunityState(enum.Enum):
class
CommunityTile
(
QFrame
):
clicked
=
pyqtSignal
()
_hover_stylesheet
=
"""
QFrame#CommunityTile {
border-radius: 5px;
background-color: palette(midlight);
}
"""
_pressed_stylesheet
=
"""
QFrame#CommunityTile {
border-radius: 5px;
background-color: palette(dark);
}
"""
_standard_stylesheet
=
"""
QFrame#CommunityTile {
border-radius: 5px;
background-color: palette(base);
}
"""
def
__init__
(
self
,
parent
,
app
,
community
):
super
().
__init__
(
parent
)
self
.
setObjectName
(
"
CommunityTile
"
)
self
.
app
=
app
self
.
community
=
community
self
.
community
.
network
.
nodes_changed
.
connect
(
self
.
handle_nodes_change
)
...
...
@@ -35,6 +51,7 @@ class CommunityTile(QFrame):
self
.
layout
().
addWidget
(
self
.
text_label
)
self
.
setFrameShape
(
QFrame
.
StyledPanel
)
self
.
setFrameShadow
(
QFrame
.
Raised
)
self
.
setStyleSheet
(
CommunityTile
.
_standard_stylesheet
)
self
.
busy
=
Busy
(
self
)
self
.
busy
.
hide
()
self
.
_state
=
CommunityState
.
NOT_INIT
...
...
@@ -130,17 +147,24 @@ class CommunityTile(QFrame):
self
.
busy
.
hide
()
def
mousePressEvent
(
self
,
event
):
self
.
clicked
.
emit
()
self
.
grabMouse
()
self
.
setStyleSheet
(
CommunityTile
.
_pressed_stylesheet
)
return
super
().
mousePressEvent
(
event
)
def
mouseReleaseEvent
(
self
,
event
):
self
.
releaseMouse
()
self
.
setStyleSheet
(
CommunityTile
.
_hover_stylesheet
)
self
.
clicked
.
emit
()
return
super
().
mouseReleaseEvent
(
event
)
def
resizeEvent
(
self
,
event
):
self
.
busy
.
resize
(
event
.
size
())
super
().
resizeEvent
(
event
)
def
enterEvent
(
self
,
event
):
self
.
setStyleSheet
(
"
color: rgb(0, 115, 173);
"
)
self
.
setStyleSheet
(
CommunityTile
.
_hover_stylesheet
)
return
super
().
enterEvent
(
event
)
def
leaveEvent
(
self
,
event
):
self
.
setStyleSheet
(
""
)
self
.
setStyleSheet
(
CommunityTile
.
_standard_stylesheet
)
return
super
().
leaveEvent
(
event
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment