Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
magicseteditor
Commits
0fa931dc
Commit
0fa931dc
authored
Sep 04, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduced flicker in card list
parent
4d66b3e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
13 deletions
+21
-13
src/gui/auto_replace_window.cpp
src/gui/auto_replace_window.cpp
+1
-1
src/gui/control/card_list.cpp
src/gui/control/card_list.cpp
+1
-1
src/gui/control/item_list.cpp
src/gui/control/item_list.cpp
+17
-9
src/gui/control/item_list.hpp
src/gui/control/item_list.hpp
+1
-1
src/gui/control/keyword_list.cpp
src/gui/control/keyword_list.cpp
+1
-1
No files found.
src/gui/auto_replace_window.cpp
View file @
0fa931dc
...
@@ -287,7 +287,7 @@ void AutoReplaceWindow::updateItem() {
...
@@ -287,7 +287,7 @@ void AutoReplaceWindow::updateItem() {
ar
->
replace
=
replace
->
GetValue
();
ar
->
replace
=
replace
->
GetValue
();
ar
->
enabled
=
enabled
->
GetValue
();
ar
->
enabled
=
enabled
->
GetValue
();
ar
->
whole_word
=
whole_word
->
GetValue
();
ar
->
whole_word
=
whole_word
->
GetValue
();
list
->
refreshList
();
list
->
refreshList
(
true
);
in_event
=
false
;
in_event
=
false
;
}
}
...
...
src/gui/control/card_list.cpp
View file @
0fa931dc
...
@@ -119,7 +119,7 @@ void CardListBase::onAction(const Action& action, bool undone) {
...
@@ -119,7 +119,7 @@ void CardListBase::onAction(const Action& action, bool undone) {
return
;
return
;
}
}
TYPE_CASE
(
action
,
ValueAction
)
{
TYPE_CASE
(
action
,
ValueAction
)
{
if
(
action
.
card
)
refreshList
();
if
(
action
.
card
)
refreshList
(
true
);
}
}
}
}
...
...
src/gui/control/item_list.cpp
View file @
0fa931dc
...
@@ -147,26 +147,34 @@ struct ItemList::ItemComparer {
...
@@ -147,26 +147,34 @@ struct ItemList::ItemComparer {
}
}
};
};
void
ItemList
::
refreshList
()
{
void
ItemList
::
refreshList
(
bool
refresh_current_only
)
{
Freeze
();
// Get all items
// Get all items
sorted_list
.
clear
();
vector
<
VoidP
>
old_sorted_list
;
swap
(
sorted_list
,
old_sorted_list
);
getItems
(
sorted_list
);
getItems
(
sorted_list
);
long
item_count
=
(
long
)
sorted_list
.
size
();
SetItemCount
(
item_count
);
// Sort the list
// Sort the list
if
(
sort_by_column
>=
0
)
{
if
(
sort_by_column
>=
0
)
{
sort
(
sorted_list
.
begin
(),
sorted_list
.
end
(),
ItemComparer
(
*
this
));
sort
(
sorted_list
.
begin
(),
sorted_list
.
end
(),
ItemComparer
(
*
this
));
}
}
// Has the entire list changed?
if
(
refresh_current_only
&&
sorted_list
==
old_sorted_list
)
{
if
(
selected_item_pos
>
0
)
RefreshItem
(
selected_item_pos
);
return
;
}
// refresh
// refresh
if
(
item_count
)
// Note: Freeze/Thaw makes flicker worse
RefreshItems
(
0
,
item_count
-
1
);
long
item_count
=
(
long
)
sorted_list
.
size
(
);
if
(
item_count
==
0
)
Refresh
(
);
SetItemCount
(
item_count
);
// (re)select current item
// (re)select current item
findSelectedItemPos
();
findSelectedItemPos
();
focusNone
();
focusNone
();
focusSelectedItem
(
true
);
focusSelectedItem
(
true
);
Thaw
();
// refresh items
if
(
item_count
==
0
)
{
Refresh
();
}
else
{
RefreshItems
(
0
,
item_count
-
1
);
}
}
}
void
ItemList
::
sortBy
(
long
column
,
bool
ascending
)
{
void
ItemList
::
sortBy
(
long
column
,
bool
ascending
)
{
...
...
src/gui/control/item_list.hpp
View file @
0fa931dc
...
@@ -71,7 +71,7 @@ class ItemList : public wxListView {
...
@@ -71,7 +71,7 @@ class ItemList : public wxListView {
/// Sort by the given column
/// Sort by the given column
virtual
void
sortBy
(
long
column
,
bool
ascending
);
virtual
void
sortBy
(
long
column
,
bool
ascending
);
/// Refresh the card list (resort, refresh and reselect current item)
/// Refresh the card list (resort, refresh and reselect current item)
void
refreshList
();
void
refreshList
(
bool
refresh_current_only
=
false
);
/// Set the image of a column header (fixes wx bug)
/// Set the image of a column header (fixes wx bug)
void
SetColumnImage
(
int
col
,
int
image
);
void
SetColumnImage
(
int
col
,
int
image
);
...
...
src/gui/control/keyword_list.cpp
View file @
0fa931dc
...
@@ -76,7 +76,7 @@ void KeywordList::onAction(const Action& action, bool undone) {
...
@@ -76,7 +76,7 @@ void KeywordList::onAction(const Action& action, bool undone) {
KeywordTextValue
*
value
=
dynamic_cast
<
KeywordTextValue
*>
(
action
.
valueP
.
get
());
KeywordTextValue
*
value
=
dynamic_cast
<
KeywordTextValue
*>
(
action
.
valueP
.
get
());
if
(
value
)
{
if
(
value
)
{
// this is indeed an action on a keyword, refresh
// this is indeed an action on a keyword, refresh
refreshList
();
refreshList
(
true
);
}
}
}
}
}
}
...
...
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