| 617 | } |
| 618 | |
| 619 | void FloatControllerPanel::UpdateCaptureMonitorInfo() { |
| 620 | //LOGI("UpdateCaptureMonitorInfo, capturing monitor: {}", capture_monitor_.capturing_monitor_name_); |
| 621 | if (capture_monitor_.monitors_.size() > 1) { |
| 622 | split_screen_btn_->show(); |
| 623 | } |
| 624 | else { |
| 625 | split_screen_btn_->hide(); |
| 626 | } |
| 627 | |
| 628 | int default_appropriate_icons_count = 3; |
| 629 | if (capture_monitor_.monitors_.size() <= default_appropriate_icons_count) { |
| 630 | setFixedWidth(kInitialWidth); |
| 631 | } |
| 632 | else { |
| 633 | setFixedWidth(kInitialWidth + (capture_monitor_.monitors_.size() - default_appropriate_icons_count) * 32); |
| 634 | } |
| 635 | int index = 0; |
| 636 | for (const auto& mon : capture_monitor_.monitors_) { |
| 637 | if (index >= kMaxGameViewCount) { |
| 638 | break; |
| 639 | } |
| 640 | auto ci = computer_icons_[index]; |
| 641 | ci->Show(); |
| 642 | ci->SetMonitorName(mon.name_); |
| 643 | if (mon.name_ == capture_monitor_.capturing_monitor_name_) { |
| 644 | ci->UpdateSelectedState(true); |
| 645 | } |
| 646 | else { |
| 647 | ci->UpdateSelectedState(false); |
| 648 | } |
| 649 | index++; |
| 650 | } |
| 651 | for (auto i = capture_monitor_.monitors_.size(); i < computer_icons_.size(); i++) { |
| 652 | auto ci = computer_icons_[i]; |
| 653 | ci->Hide(); |
| 654 | } |
| 655 | |
| 656 | // 当远端只有一个屏幕的时候,屏幕图标始终为选中状态 |
| 657 | if (1 == capture_monitor_.monitors_.size()) { |
| 658 | computer_icons_[0]->UpdateSelectedState(true); |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | void FloatControllerPanel::SwitchMonitor(ComputerIcon* w) { |
| 663 | context_->SendAppMessage(MsgClientSwitchMonitor { |
nothing calls this directly
no test coverage detected