Skip to content

Commit

Permalink
0.1.7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolka committed Oct 6, 2018
1 parent e6831be commit a901777
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion egg-player.pri
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RC_ICONS = resource/images/egg/egg.ico

VERSION = 0.1.6.18
VERSION = 0.1.7.0

QMAKE_TARGET = Egg Player
QMAKE_TARGET_PRODUCT = Egg Player
Expand Down
2 changes: 1 addition & 1 deletion src/core/config/configlibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

void ConfigLibrary::setDefaults()
{
setDefault("cellPadding", 5);
setDefault("cellPadding", 10);
setDefault("itemHeight", 50);
setDefault("paths", QJsonArray({QStandardPaths::writableLocation(QStandardPaths::MusicLocation)}));
setDefault("scrollBarWidth", 12);
Expand Down
22 changes: 22 additions & 0 deletions src/widgets/librarywidget.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "librarywidget.hpp"

#include <ShellScalingApi.h>

LibraryWidget::LibraryWidget(QWidget *parent)
: AudiosWidget(parent)
{
Expand All @@ -10,3 +12,23 @@ LibraryWidget::LibraryWidget(QWidget *parent)
addColumn(AudiosWidget::Genre);
addColumn(AudiosWidget::Duration, Qt::AlignRight, false);
}

void LibraryWidget::resizeEvent(QResizeEvent *event)
{
adjustToWidth(event->size().width());

AudiosWidget::resizeEvent(event);
}

void LibraryWidget::adjustToWidth(int width)
{
const static float factor = static_cast<float>(GetScaleFactorForDevice(DEVICE_PRIMARY)) / 100.0f;

const bool hideAlbum = width < 675 * factor;
const bool hideGenre = width < 925 * factor;
const bool hideYear = width < 1025 * factor;

setColumnHidden(2, hideAlbum);
setColumnHidden(3, hideYear);
setColumnHidden(4, hideGenre);
}
8 changes: 8 additions & 0 deletions src/widgets/librarywidget.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#ifndef LIBRARYWIDGET_HPP
#define LIBRARYWIDGET_HPP

#include <QResizeEvent>

#include "audioswidget.hpp"

class LibraryWidget : public AudiosWidget
{
public:
LibraryWidget(QWidget *parent = nullptr);

protected:
void resizeEvent(QResizeEvent *event);

private:
void adjustToWidth(int width);
};

#endif // LIBRARYWIDGET_HPP
9 changes: 1 addition & 8 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# Things to do

## User interface
- only show certain column based on the size

## Future
- fuzzy library searching by typing
- save playlist with path and unique info
# Things to do

0 comments on commit a901777

Please sign in to comment.