kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37644
Re: [PATCH 2/4 (master)] Pcbnew: fix column width in Nets dialog.
Only just noticed that the patch has a little coding style issue.
Attached patch is contain a fix.
Sorry.
ср, 26 сент. 2018 г. в 14:33, Seth Hillbrand <seth@xxxxxxxxxxxxx>:
> Hi Konstantin-
>
> I modified this slightly for compiling and pushed your patch. JP is
> right, constexpr should only work for a literal it can figure out at
> compile-time. But there's no real downside to just returning the
> translated wxString.
>
> Thank you for your contribution to KiCad!
> -Seth
>
> Am Mi., 26. Sep. 2018 um 01:28 Uhr schrieb Константин Барановский <
> baranovskiykonstantin@xxxxxxxxx>:
>
>> Hi JP!
>>
>> That labels switches to selected language and back as expected.
>>
>> ср, 26 сент. 2018 г. в 11:02, jp charras <jp.charras@xxxxxxxxxx>:
>>
>>> Le 26/09/2018 à 09:51, Константин Барановский a écrit :
>>> > Hi Seth!
>>> >
>>> > Something like this (see attachment)?
>>> > Not sure that I done it right, but it works fine.
>>>
>>> Hi Konstantin,
>>>
>>> They are I18N strings. Are there correctly translated ?
>>> Especially after switching to an other language.
>>>
>>> Any translated string must be created on the fly to be correctly
>>> translated.
>>>
>>> >
>>> > вт, 25 сент. 2018 г. в 22:24, <seth@xxxxxxxxxxxxx
>>> > <mailto:seth@xxxxxxxxxxxxx>>:
>>> >
>>> > Hi Baranovskiy-
>>> >
>>> > On 2018-09-25 07:17, Baranovskiy Konstantin wrote:
>>> > > Nets dialog (Inspect->List Nets) contains list control
>>> > > that has very small width for first and last columns.
>>> > > Changed algorithm for calculating optimal values for
>>> > > column width.
>>> > > ---
>>> > > .../dialogs/dialog_select_net_from_list.cpp | 49
>>> > +++++++++++++++----
>>> > > 1 file changed, 39 insertions(+), 10 deletions(-)
>>> > >
>>> > > diff --git a/pcbnew/dialogs/dialog_select_net_from_list.cpp
>>> > > b/pcbnew/dialogs/dialog_select_net_from_list.cpp
>>> > > index 39a403b65..960c5afbd 100644
>>> > > --- a/pcbnew/dialogs/dialog_select_net_from_list.cpp
>>> > > +++ b/pcbnew/dialogs/dialog_select_net_from_list.cpp
>>> > > @@ -42,6 +42,10 @@
>>> > > #include <pcb_painter.h>
>>> > > #include <connectivity_data.h>
>>> > >
>>> > > +#define COLUMN_HEADER_NET _( "Net" )
>>> > > +#define COLUMN_HEADER_NAME _( "Name" )
>>> > > +#define COLUMN_HEADER_COUNT _( "Pad Count" )
>>> >
>>> > This is overall a good patch. Can you replace the three defines
>>> here
>>> > with C++-style constexpr functions?
>>> >
>>> > -Seth
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Mailing list: https://launchpad.net/~kicad-developers
>>> > Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> > Unsubscribe : https://launchpad.net/~kicad-developers
>>> > More help : https://help.launchpad.net/ListHelp
>>> >
>>>
>>>
>>> --
>>> Jean-Pierre CHARRAS
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help : https://help.launchpad.net/ListHelp
>>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>>
>
From 5213383e387e4768eaae9390f2d0c37bd782e3ba Mon Sep 17 00:00:00 2001
From: Baranovskiy Konstantin <baranovskiykonstantin@xxxxxxxxx>
Date: Wed, 26 Sep 2018 17:22:34 +0300
Subject: [PATCH 5/5] Fix coding style in f68581d.
---
pcbnew/dialogs/dialog_select_net_from_list.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pcbnew/dialogs/dialog_select_net_from_list.cpp b/pcbnew/dialogs/dialog_select_net_from_list.cpp
index 6db4efaac..dd89ec486 100644
--- a/pcbnew/dialogs/dialog_select_net_from_list.cpp
+++ b/pcbnew/dialogs/dialog_select_net_from_list.cpp
@@ -245,8 +245,8 @@ void DIALOG_SELECT_NET_FROM_LIST::adjustListColumns( int aWidth )
// Considering left and right margins.
// For wxRanderGeneric it is 5px.
- w0 = std::max( w0+10, minw);
- w2 = std::max( w2+10, minw);
+ w0 = std::max( w0+10, minw );
+ w2 = std::max( w2+10, minw );
m_netsList->GetColumn( 0 )->SetWidth( w0 );
m_netsList->GetColumn( 2 )->SetWidth( w2 );
--
2.19.0
References