Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
chatty
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Bernard
chatty
Commits
4555b661
Commit
4555b661
authored
Jul 08, 2019
by
Tobias Bernard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message bubbles: de-duplicate CSS, nicer shadows, color tweaks
parent
28fa1d34
Pipeline
#21018
passed with stages
in 3 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
73 deletions
+44
-73
src/chatty-message-list.c
src/chatty-message-list.c
+1
-73
src/css/style.css
src/css/style.css
+43
-0
No files found.
src/chatty-message-list.c
View file @
4555b661
...
...
@@ -81,77 +81,6 @@ header_strings_t header_strings[3] = {
},
};
static
void
init_css
(
void
)
{
GdkScreen
*
screen
;
GtkCssProvider
*
cssProvider
;
screen
=
gdk_screen_get_default
();
cssProvider
=
gtk_css_provider_new
();
gtk_css_provider_load_from_data
(
GTK_CSS_PROVIDER
(
cssProvider
),
" .message_list {
\n
"
" color: black;
\n
"
" background-color: white;
\n
"
"}
\n
"
" .bubble_green {
\n
"
" font-size: 17px;
\n
"
" background-color: #e0fad0;
\n
"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);
\n
"
" border-radius: 6px;
\n
"
" padding-left: 10px;
\n
"
" padding-right: 10px;
\n
"
" padding-top: 8px;
\n
"
" padding-bottom: 8px;
\n
"
"}
\n
"
" .bubble_blue {
\n
"
" font-size: 17px;
\n
"
" color: black;
\n
"
" background-color: #e4f0fc;
\n
"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);
\n
"
" border-radius: 6px;
\n
"
" padding-left: 10px;
\n
"
" padding-right: 10px;
\n
"
" padding-top: 8px;
\n
"
" padding-bottom: 8px;
\n
"
"}
\n
"
" .bubble_purple {
\n
"
" font-size: 14px;
\n
"
" color: white;
\n
"
" background-color: #862d86;
\n
"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);
\n
"
" border-radius: 6px;
\n
"
" padding-left: 10px;
\n
"
" padding-right: 10px;
\n
"
" padding-top: 8px;
\n
"
" padding-bottom: 8px;
\n
"
"}
\n
"
" .bubble_white {
\n
"
" font-size: 17px;
\n
"
" color: black;
\n
"
" background-color: white;
\n
"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);
\n
"
" border-radius: 6px;
\n
"
" padding-left: 10px;
\n
"
" padding-right: 10px;
\n
"
" padding-top: 8px;
\n
"
" padding-bottom: 8px;
\n
"
"}
\n
"
" .label_disclaim {
\n
"
" font-size: 16px;
\n
"
" font-weight: bold;
\n
"
" padding-top: 120px;
\n
"
" padding-bottom: 20px;
\n
"
"}
\n
"
,
-
1
,
NULL
);
gtk_style_context_add_provider_for_screen
(
screen
,
GTK_STYLE_PROVIDER
(
cssProvider
),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
);
}
static
void
msg_list_cmd_copy
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
...
...
@@ -688,6 +617,7 @@ chatty_msg_list_add_message (ChattyMsgList *self,
}
sc
=
gtk_widget_get_style_context
(
GTK_WIDGET
(
label_msg
));
gtk_style_context_add_class
(
sc
,
"message_bubble"
);
gtk_style_context_add_class
(
sc
,
style
);
gtk_box_pack_start
(
vbox
,
GTK_WIDGET
(
ebox
),
FALSE
,
FALSE
,
0
);
...
...
@@ -734,8 +664,6 @@ chatty_msg_list_constructed (GObject *object)
ChattyMsgListPrivate
*
priv
=
chatty_msg_list_get_instance_private
(
self
);
const
gchar
*
path
;
init_css
();
sc
=
gtk_widget_get_style_context
(
GTK_WIDGET
(
priv
->
list
));
gtk_style_context_add_class
(
sc
,
"message_list"
);
...
...
src/css/style.css
View file @
4555b661
...
...
@@ -77,3 +77,46 @@
.list_select
:selected
{
background-color
:
#f5f5f5
;
}
/* MESSAGE LIST AND BUBBLES */
.message_list
{
color
:
black
;
background-color
:
white
;
}
.message_bubble
{
font-size
:
16px
;
color
:
black
;
border-radius
:
9px
;
box-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,
0.4
);
padding-top
:
6px
;
padding-bottom
:
6px
;
padding-left
:
10px
;
padding-right
:
10px
;
}
.bubble_white
{
background-color
:
white
;
}
.bubble_blue
{
background-color
:
#e4f0fc
;
}
.bubble_green
{
background-color
:
#e2fae7
;
}
.bubble_purple
{
font-size
:
14px
;
color
:
white
;
background-color
:
#862d86
;
}
.label_disclaim
{
font-size
:
16px
;
font-weight
:
bold
;
padding-top
:
120px
;
padding-bottom
:
20px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment