Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modified the _set_value function logic based on the mode of MMenu #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaonuoAndy
Copy link

modify logic:

  1. mode is Cascader, value from long path
  2. mode is Exclusive , value form action.get('value')
  3. mode is Single, value form [action.get('value')]

act_value = act.property("value")
else:
act_value = act.property("value")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

读了下上下文 感觉这里可以直接简化成这样

act_value = self.property("cascader") and act.property("long_path") or act.property("value")

Comment on lines +550 to +555
selected_data = ['/'.join(map(str, value))]
else:
if self._action_group.isExclusive():
selected_data = [value]
else:
selected_data = value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你看看如果是修改成这样是否也能符合预期?

Suggested change
selected_data = ['/'.join(map(str, value))]
else:
if self._action_group.isExclusive():
selected_data = [value]
else:
selected_data = value
selected_data = ['/'.join(map(str, value))]
else:
selected_data = [value]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把 "/" 改为 self.property("separator") 吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants