Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
822cf0ad07 | ||
|
|
67f04a81b3 | ||
|
|
9232ad0125 | ||
|
|
0de87b3e1e | ||
|
|
74b8cd6156 | ||
|
|
ac959387fe | ||
|
|
ffd8ce9281 |
@@ -2,7 +2,7 @@ Strawberry Music Player
|
||||
=======================
|
||||
ChangeLog
|
||||
|
||||
Version 1.1.0-rc2 (2024.07.09):
|
||||
Version 1.1.0-rc3 (2024.07.09):
|
||||
|
||||
Bugfixes:
|
||||
* Fixed crash when pressing CTRL + C (#1359).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
set(STRAWBERRY_VERSION_MAJOR 1)
|
||||
set(STRAWBERRY_VERSION_MINOR 1)
|
||||
set(STRAWBERRY_VERSION_PATCH 0)
|
||||
set(STRAWBERRY_VERSION_PRERELEASE rc2)
|
||||
set(STRAWBERRY_VERSION_PRERELEASE rc3)
|
||||
|
||||
set(INCLUDE_GIT_REVISION OFF)
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
|
||||
@@ -64,7 +62,7 @@ class TagReaderTagLib : public TagReaderBase {
|
||||
}
|
||||
|
||||
static inline std::string TagLibStringToStdString(const TagLib::String &s) {
|
||||
return std::string(s.toCString(), s.length());
|
||||
return std::string(s.toCString(true), s.length());
|
||||
}
|
||||
|
||||
static inline TagLib::String QStringToTagLibString(const QString &s) {
|
||||
@@ -77,9 +75,9 @@ class TagReaderTagLib : public TagReaderBase {
|
||||
|
||||
static inline void AssignTagLibStringToStdString(const TagLib::String &tstr, std::string *output) {
|
||||
|
||||
std::string stdstr = TagLibStringToStdString(tstr);
|
||||
boost::trim(stdstr);
|
||||
output->assign(stdstr);
|
||||
const QString qstr = TagLibStringToQString(tstr).trimmed();
|
||||
const QByteArray data = qstr.toUtf8();
|
||||
output->assign(data.constData(), data.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -710,6 +710,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
|
||||
|
||||
if (current_item_index_.isValid() && !is_stopping) {
|
||||
InformOfCurrentSongChange(false);
|
||||
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
|
||||
emit MaybeAutoscroll(autoscroll);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ constexpr int kMagicNumber = 0x502C9510;
|
||||
StretchHeaderView::StretchHeaderView(const Qt::Orientation orientation, QWidget *parent)
|
||||
: QHeaderView(orientation, parent),
|
||||
stretch_enabled_(false),
|
||||
in_mouse_move_event_(false) {
|
||||
in_mouse_move_event_(false),
|
||||
forced_resize_logical_index_(-1) {
|
||||
|
||||
setDefaultSectionSize(100);
|
||||
setMinimumSectionSize(30);
|
||||
@@ -326,39 +327,48 @@ void StretchHeaderView::SectionResized(const int logical_index, const int old_si
|
||||
return;
|
||||
}
|
||||
|
||||
if (in_mouse_move_event_) {
|
||||
bool resized = false;
|
||||
if (new_size >= minimumSectionSize()) {
|
||||
// Find the visible section to the right of the section that's being resized
|
||||
const int visual_index = visualIndex(logical_index);
|
||||
int right_section_logical_index = -1;
|
||||
int right_section_visual_index = -1;
|
||||
for (int i = 0; i <= count(); ++i) {
|
||||
if (!isSectionHidden(i) &&
|
||||
visualIndex(i) > visual_index &&
|
||||
(right_section_visual_index == -1 || visualIndex(i) < right_section_visual_index)) {
|
||||
right_section_logical_index = i;
|
||||
right_section_visual_index = visualIndex(i);
|
||||
}
|
||||
}
|
||||
if (right_section_logical_index != -1) {
|
||||
const int right_section_size = sectionSize(right_section_logical_index) + (old_size - new_size);
|
||||
if (right_section_size >= minimumSectionSize()) {
|
||||
column_widths_[logical_index] = static_cast<ColumnWidthType>(new_size) / width();
|
||||
column_widths_[right_section_logical_index] = static_cast<ColumnWidthType>(right_section_size) / width();
|
||||
in_mouse_move_event_ = false;
|
||||
NormaliseWidths(QList<int>() << right_section_logical_index);
|
||||
ResizeSections(QList<int>() << right_section_logical_index);
|
||||
in_mouse_move_event_ = true;
|
||||
resized = true;
|
||||
}
|
||||
if (logical_index == forced_resize_logical_index_) {
|
||||
forced_resize_logical_index_ = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_mouse_move_event_) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool resized = false;
|
||||
if (new_size >= minimumSectionSize()) {
|
||||
// Find the visible section to the right of the section that's being resized
|
||||
const int visual_index = visualIndex(logical_index);
|
||||
int right_section_logical_index = -1;
|
||||
int right_section_visual_index = -1;
|
||||
for (int i = 0; i <= count(); ++i) {
|
||||
if (!isSectionHidden(i) &&
|
||||
visualIndex(i) > visual_index &&
|
||||
(right_section_visual_index == -1 || visualIndex(i) < right_section_visual_index)) {
|
||||
right_section_logical_index = i;
|
||||
right_section_visual_index = visualIndex(i);
|
||||
}
|
||||
}
|
||||
if (!resized) {
|
||||
in_mouse_move_event_ = true;
|
||||
resizeSection(logical_index, old_size);
|
||||
in_mouse_move_event_ = false;
|
||||
if (right_section_logical_index != -1) {
|
||||
const int right_section_size = sectionSize(right_section_logical_index) + (old_size - new_size);
|
||||
if (right_section_size >= minimumSectionSize()) {
|
||||
column_widths_[logical_index] = static_cast<ColumnWidthType>(new_size) / width();
|
||||
column_widths_[right_section_logical_index] = static_cast<ColumnWidthType>(right_section_size) / width();
|
||||
in_mouse_move_event_ = false;
|
||||
NormaliseWidths(QList<int>() << right_section_logical_index);
|
||||
ResizeSections(QList<int>() << right_section_logical_index);
|
||||
in_mouse_move_event_ = true;
|
||||
resized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!resized) {
|
||||
forced_resize_logical_index_ = logical_index;
|
||||
in_mouse_move_event_ = false;
|
||||
resizeSection(logical_index, old_size);
|
||||
in_mouse_move_event_ = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ class StretchHeaderView : public QHeaderView {
|
||||
QVector<ColumnWidthType> column_widths_;
|
||||
|
||||
bool in_mouse_move_event_;
|
||||
int forced_resize_logical_index_;
|
||||
};
|
||||
|
||||
#endif // STRETCHHEADERVIEW_H
|
||||
|
||||
Reference in New Issue
Block a user