Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Tryton
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tryton
Tryton
Commits
ac710fb7
Commit
ac710fb7
authored
10 years ago
by
Cédric Krier
Browse files
Options
Downloads
Patches
Plain Diff
Fix color and readonly for new date/time widgets
issue4457 review5981002
parent
82f49d53
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tryton/common/datetime_.py
+16
-0
16 additions, 0 deletions
tryton/common/datetime_.py
tryton/gui/window/view_form/view/form_gtk/calendar.py
+13
-7
13 additions, 7 deletions
tryton/gui/window/view_form/view/form_gtk/calendar.py
with
29 additions
and
7 deletions
tryton/common/datetime_.py
+
16
−
0
View file @
ac710fb7
...
...
@@ -435,6 +435,22 @@
elif
prop
.
name
==
'
time-format
'
:
return
self
.
__time
.
props
.
format
def
modify_bg
(
self
,
state
,
color
):
self
.
__date
.
modify_bg
(
state
,
color
)
self
.
__time
.
child
.
modify_bg
(
state
,
color
)
def
modify_base
(
self
,
state
,
color
):
self
.
__date
.
modify_base
(
state
,
color
)
self
.
__time
.
child
.
modify_base
(
state
,
color
)
def
modify_fg
(
self
,
state
,
color
):
self
.
__date
.
modify_fg
(
state
,
color
)
self
.
__time
.
child
.
modify_fg
(
state
,
color
)
def
modify_text
(
self
,
state
,
color
):
self
.
__date
.
modify_text
(
state
,
color
)
self
.
__time
.
child
.
modify_text
(
state
,
color
)
gobject
.
type_register
(
DateTime
)
...
...
This diff is collapsed.
Click to expand it.
tryton/gui/window/view_form/view/form_gtk/calendar.py
+
13
−
7
View file @
ac710fb7
...
...
@@ -33,7 +33,8 @@
return
self
.
entry
def
_set_editable
(
self
,
value
):
self
.
real_entry
.
set_editable
(
value
)
self
.
entry
.
set_editable
(
value
)
self
.
entry
.
set_icon_sensitive
(
gtk
.
ENTRY_ICON_SECONDARY
,
value
)
def
_readonly_set
(
self
,
value
):
self
.
_set_editable
(
not
value
)
...
...
@@ -79,6 +80,12 @@
super
(
Time
,
self
).
__init__
(
view
,
attrs
,
_entry
=
TimeEntry
)
self
.
entry
.
set_focus_chain
([
self
.
entry
.
get_child
()])
def
_color_widget
(
self
):
return
self
.
entry
.
child
def
_set_editable
(
self
,
value
):
self
.
entry
.
set_sensitive
(
value
)
@property
def
real_entry
(
self
):
return
self
.
entry
.
get_child
()
...
...
@@ -112,8 +119,5 @@
child
.
connect
(
'
focus-out-event
'
,
lambda
x
,
y
:
self
.
_focus_out
())
self
.
widget
.
pack_start
(
self
.
entry
,
expand
=
False
,
fill
=
False
)
def
_color_widget
(
self
):
return
self
.
entry
.
get_children
()[
0
]
# XXX not always sure to have Date
def
_set_editable
(
self
,
value
):
for
child
in
self
.
entry
.
get_children
():
...
...
@@ -118,8 +122,10 @@
def
_set_editable
(
self
,
value
):
for
child
in
self
.
entry
.
get_children
():
if
not
hasattr
(
child
,
'
set_editable
'
):
child
=
child
.
child
child
.
set_editable
(
value
)
if
isinstance
(
child
,
gtk
.
Entry
):
child
.
set_editable
(
value
)
child
.
set_icon_sensitive
(
gtk
.
ENTRY_ICON_SECONDARY
,
value
)
elif
isinstance
(
child
,
gtk
.
ComboBoxEntry
):
child
.
set_sensitive
(
value
)
def
set_format
(
self
,
record
,
field
):
if
field
and
record
:
...
...
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